This PR proposes that bitcoind send its logs to standard output instead of the debug.log file. With this change journald reads and process the logs like those of any other system service.
Why
This change has, in my opinion, a couple benefits:
bitcoind logs are queried with journalctl like any other system service, allowing more nuanced queries. For instance:
As part of its duties systemd-journald takes care of prunning old logs. With debug.log we have an unmanaged file that always grows and has to be pruned manually from time to time by the node operator.
What
This PR proposes that
bitcoind
send its logs to standard output instead of thedebug.log
file. With this changejournald
reads and process the logs like those of any other system service.Why
This change has, in my opinion, a couple benefits:
bitcoind logs are queried with
journalctl
like any other system service, allowing more nuanced queries. For instance:As part of its duties
systemd-journald
takes care of prunning old logs. Withdebug.log
we have an unmanaged file that always grows and has to be pruned manually from time to time by the node operator.How
nodebuglogfile=1
turns off file logging and turns on STDOUT output. A change in the type of systemd service is also needed for journald to be able to read the logs: https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type=Scope