|
| 1 | +# Logging |
| 2 | + |
| 3 | +Last updated: September 12, 2021 |
| 4 | + |
| 5 | +## How to configure bitcoind debug logging |
| 6 | + |
| 7 | +### On node startup |
| 8 | + |
| 9 | +Logging can be configured on bitcoind startup with the `-debug=` option. |
| 10 | + |
| 11 | +For example, `bitcoind -debug=lock -debug=i2p` on the command line will turn on |
| 12 | +logging of lock contentions and I2P information in the debug log. |
| 13 | + |
| 14 | +The same options can be used in the `bitcoin.conf` file without the leading |
| 15 | +hyphen and with one command per line: |
| 16 | + |
| 17 | + debug=lock |
| 18 | + debug=i2p |
| 19 | + |
| 20 | +### On a running node |
| 21 | + |
| 22 | +Logging can be read and set on a running instance of bitcoind using the |
| 23 | +logging RPC: |
| 24 | + |
| 25 | + bitcoin-cli logging |
| 26 | + bitcoin-cli help logging |
| 27 | + |
| 28 | +#### Examples |
| 29 | + |
| 30 | +To turn on debug=net: |
| 31 | + |
| 32 | + bitcoin-cli logging '["net"]' |
| 33 | + |
| 34 | +To turn off debug=net: |
| 35 | + |
| 36 | + bitcoin-cli logging [] '["net"]' |
| 37 | + |
| 38 | +To turn on debug=all: |
| 39 | + |
| 40 | + bitcoin-cli logging '["all"]' |
| 41 | + |
| 42 | +To turn off all debug logging: |
| 43 | + |
| 44 | + bitcoin-cli logging [] '["all"]' |
| 45 | + |
| 46 | + |
| 47 | +## Log categories |
| 48 | + |
| 49 | +Here are the log categories and a description of each: |
| 50 | + |
| 51 | + addrman: Address Manager. Messages about the status of the address |
| 52 | + manager and when addresses are added or removed from the address |
| 53 | + manager database. |
| 54 | + |
| 55 | + bench: Messages about the benchmark performance of various parts of |
| 56 | + the software that can have performance issues. |
| 57 | + |
| 58 | + cmpctblock: Messages about the Compact Blocks relay protocol, |
| 59 | + including when blocks are partially downloaded or reconstructed. |
| 60 | + |
| 61 | + coindb: Coin Database. Messages about the coin database which contains |
| 62 | + the UTXO set, including messages about database flushes and writes. |
| 63 | + |
| 64 | + estimatefee: Messages about the fee estimation algorithm, including |
| 65 | + messages about when fee estimates are requested and information about |
| 66 | + the status of the fee estimator. |
| 67 | + |
| 68 | + http: Messages related to the HTTP server that is used to handle the |
| 69 | + RPC requests. These messages will typically be for the startup and |
| 70 | + shutdown of the server as well as received requests. |
| 71 | + |
| 72 | + i2p: All messages related to using the I2P privacy network. |
| 73 | + |
| 74 | + ipc: All requests and responses between processes. See |
| 75 | + [doc/multiprocess.md](https://github.com/bitcoin/bitcoin/blob/master/doc/multiprocess.md). |
| 76 | + |
| 77 | + libevent: Messages from the libevent library used for the HTTP server. |
| 78 | + |
| 79 | + libevent: Messages from the libevent library used for the HTTP server. |
| 80 | + |
| 81 | + lock: All lock contentions and their duration. |
| 82 | + |
| 83 | + mempool: Messages related to actions done in the memory pool, most |
| 84 | + frequently transaction acceptance (`AcceptToMemoryPool`). Also |
| 85 | + includes transaction removals. |
| 86 | + |
| 87 | + mempoolrej: Messages about transactions rejected from the memory pool. |
| 88 | + |
| 89 | + net: All messages related to communicating with other nodes on the |
| 90 | + network, including what P2P messages were sent and received and to |
| 91 | + whom and other information about the network messages. |
| 92 | + |
| 93 | + proxy: Messages about using a SOCKS5 proxy and its authentication. |
| 94 | + |
| 95 | + prune: Messages about local blockchain pruning, including the result |
| 96 | + of a pruning operation. |
| 97 | + |
| 98 | + qt: Messages about Qt, the GUI framework. |
| 99 | + |
| 100 | + rand: Messages for when randomness is needed by any function. |
| 101 | + |
| 102 | + reindex: Messages about the reindexing process, in particular errors |
| 103 | + about out-of-order blocks and repeated blocks. |
| 104 | + |
| 105 | + rpc: Messages about the RPC server, including its startup and shutdown |
| 106 | + as well as when commands are issued. |
| 107 | + |
| 108 | + selectcoins: Coin Selection. Messages about the UTXOs that are |
| 109 | + selected when sending money. |
| 110 | + |
| 111 | + tor: All messages related to using a TOR SOCKS5 proxy and TOR hidden |
| 112 | + service (used for receiving incoming connections over TOR). This |
| 113 | + includes messages about the creation and shutdown of the TOR hidden |
| 114 | + service and messages about the connection to the TOR proxy. |
| 115 | + |
| 116 | + validation: All messages related to the validation interface, most |
| 117 | + frequently `TransactionAddedToMempool` and `stored orphan tx`. |
| 118 | + |
| 119 | + walletdb (db in v.0.19 and earlier): Messages about the status of the |
| 120 | + Berkeley Database engine used for the wallet database, including |
| 121 | + messages about database flushes. |
| 122 | + |
| 123 | + zmq: Messages about the ZeroMQ notification system, including the |
| 124 | + startup and shutdown of the service as well as when notifications are |
| 125 | + issued and new clients connected. |
| 126 | + |
0 commit comments