fort-nix / nix-bitcoin

A collection of Nix packages and NixOS modules for easily installing full-featured Bitcoin nodes with an emphasis on security.
https://nixbitcoin.org
MIT License
513 stars 107 forks source link

bitcoind debug.log #665

Closed OliverOffing closed 11 months ago

OliverOffing commented 11 months ago

I wanted to contribute to https://github.com/bitcoin-data/block-arrival-times but I just noticed I don't have old log data. What would be the best way to either increase journald's max log size for just the bitcoind service, or alternatively have bitcoind write to debug.log?

0xB10C commented 11 months ago

nix-bitcoin sets nodebuglog=1 by default

https://github.com/fort-nix/nix-bitcoin/blob/1d73b21f108cfddc928395bedd1119fc83dff489/modules/bitcoind.nix#L286

You can overwrite this with, e.g., debuglogfile=debug.log in extraConfig:

services.bitcoind.extraConfig = ''
  debuglogfile=debug.log
'';
jonasnick commented 11 months ago

Hi @OliverOffing. You can increase the journal size to 8 GB, for example, by adding

services.journald.extraConfig = "SystemMaxUse=8G";

to your configuration. You can verify that this worked by checking the logs of the journal:

journalctl -b -u systemd-journald
OliverOffing commented 11 months ago

This is very useful. Thanks all!