|Subject:||Logging to syslog - where should I start?|
|Date:||Fri, 28 Aug 2020 10:18:22 +0200|
|User-agent:||Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0|
Hello,Gnunet is flooding my disk with a huge log file in ~/.cache/gnunet/gnunet-2020-080-26.log, this file contains lots of such entries:
Aug 28 10:01:06-523074 util-service-967 WARNING Processing code for message of type 367 did not call `GNUNET_SERVICE_client_continue' after 39 h
Before looking at the root cause of these logs, I'd like gnunet NOT to log things on-disk, but to send its logs to syslog() instead so I could review them with systemd's journalctl. Question is - how should I proceed?
I noticed that gnunet mostly logs things by calling a LOG() function that is redefined on a per-module basis and usually points to GNUNET_log_from(), the latter being a short #define snippet in include/gnunet_common.h that may call GNUNET_log_from_nocheck() from util/common_logging.c, which itself calls a static mylog() function from the same module.
The amount of chained functions and definitions is slightly confusing me, so before blindly hacking the code, I'm asking here: what would be the "proper" way I should follow to make gnunet output logs through syslog? In common_logging.c there are some convenience functions like GNUNET_logger_add() and GNUNET_logger_remove() - but I have no clue how one is supposed to interact with them. Any hints please?
On a side note - is there some kind of documentation about the code architecture? I mean typically - "what does module x is supposed to do, in what context it is called and by who".
|[Prev in Thread]||Current Thread||[Next in Thread]|