Skip to content

Log Settings

Eric Voskuil edited this page May 2, 2017 · 12 revisions

The following logging settings are implemented in the libbitcoin-network and exposed in both Bitcoin Node (BN) and Bitcoin Server (BS).

[log]
# The debug log file path, defaults to 'debug.log'.
debug_file = debug.log
# The error log file path, defaults to 'error.log'.
error_file = error.log
# The log archive directory, defaults to 'archive'.
archive_directory = archive
# The size at which a log is archived, defaults to 10000000 (0 disables).
rotation_size = 10000000
# The minimum free space required in the archive directory, defaults to 0.
minimum_free_space = 0
# The maximum combined size of archived logs, defaults to 0 (maximum).
maximum_archive_size = 0
# The maximum number of logs to archive, defaults to 0 (maximum).
maximum_archive_files = 0
# The address of the statistics collection server, defaults to none.
statistics_server = 0.0.0.0:0
# Enable verbose logging, defaults to false.
verbose = false

A log begins with a === startup [date time] === section, which includes each relevant message type and the local date-time. Each log entry is prefixed with UTC time of day (no date), entry type and the libbitcoin library from with the entry originates.

debug_file

This file can get large. An SSD path is recommended. This log includes all entry types. This is the only target for DEBUG and VERBOSE entries, INFO log entries are directed to the console as well. For debug builds this log also contains a significant rate of object construction and destruction entries. It is not recommended to use debug builds in a production environment.

00:58:35.703161 DEBUG [node] ================= startup 03/17/17 17:58:35 ==================
00:58:35.703660 INFO [node] ================= startup 03/17/17 17:58:35 ==================
00:58:35.709695 WARNING [node] ================= startup 03/17/17 17:58:35 ==================
00:58:35.719710 ERROR [node] ================= startup 03/17/17 17:58:35 ==================
00:58:35.728710 FATAL [node] ================= startup 03/17/17 17:58:35 ==================

error_file

This file is small. Entries overlap with the debug log, summarizing potential problems as WARNING, actual failures as ERROR, and aborts as FATAL (where possible).

01:08:24.967015 WARNING [node] ================= startup 03/17/17 18:08:24 ==================
01:08:24.980022 ERROR [node] ================= startup 03/17/17 18:08:24 ==================
01:08:24.992031 FATAL [node] ================= startup 03/17/17 18:08:24 ==================

archive_directory

Ideally this should not be on the same drive as the blockchain or the debug log. It is not important to use an SSD for archives.

rotation_size

This is the byte size at which a log file is rotated. A value of zero disabled log rotation. When enabled logs (of any size) are rotated on each shutdown.

minimum_free_space

Oldest logs are discarded in order to preserved this number of free bytes on the archive drive.

maximum_archive_size

Oldest logs are discarded in order to prevent the total archive from exceeding this number of bytes.

maximum_archive_files

Oldest logs are discarded in order to not exceed this number of archived log files.

statistics_server

This is a statsd UDP sink for statistics logging. This is initialized if configured, but no messages are currently written.

verbose

Log send and receive of all network messages and BS queries to the debug log.

Clone this wiki locally