-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(validator-node): add logging (#4189)
Description --- Adds log4rs to validator node Motivation and Context --- Currently, no logs are produced fr the validator node How Has This Been Tested? --- Manually
- Loading branch information
Showing
3 changed files
with
194 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
# A sample log configuration file for running in release mode. By default, this configuration splits up log messages to | ||
# three destinations: | ||
# * Console: For log messages with level INFO and higher | ||
# * log/validator-node/network.log: INFO-level logs related to the comms crate. This file will be quite busy since there | ||
# are lots of P2P debug messages, and so this traffic is segregated from the application log messages | ||
# * log/validator-node/base_layer.log: Non-comms related INFO-level messages and higher are logged into this file | ||
# * log/validator-node/other.log: Third-party crates' messages will be logged here at an ERROR level | ||
# | ||
# See https://docs.rs/log4rs/0.8.3/log4rs/encode/pattern/index.html for deciphering the log pattern. The log format | ||
# used in this sample configuration prints messages as: | ||
# timestamp [target] LEVEL message | ||
refresh_rate: 30 seconds | ||
appenders: | ||
# An appender named "stdout" that writes to stdout | ||
stdout: | ||
kind: console | ||
|
||
encoder: | ||
pattern: "{d(%H:%M)} {h({l}):5} {m}{n}" | ||
filters: | ||
- kind: threshold | ||
level: warn | ||
|
||
# An appender named "network" that writes to a file with a custom pattern encoder | ||
network: | ||
kind: rolling_file | ||
path: "log/validator-node/network.log" | ||
policy: | ||
kind: compound | ||
trigger: | ||
kind: size | ||
limit: 10mb | ||
roller: | ||
kind: fixed_window | ||
base: 1 | ||
count: 5 | ||
pattern: "log/validator-node/network.{}.log" | ||
encoder: | ||
pattern: "{d(%Y-%m-%d %H:%M:%S.%f)} [{t}] [Thread:{I}] {l:5} {m}{n} // {f}:{L}" | ||
|
||
# An appender named "base_layer" that writes to a file with a custom pattern encoder | ||
base_layer: | ||
kind: rolling_file | ||
path: "log/validator-node/base_layer.log" | ||
policy: | ||
kind: compound | ||
trigger: | ||
kind: size | ||
limit: 10mb | ||
roller: | ||
kind: fixed_window | ||
base: 1 | ||
count: 5 | ||
pattern: "log/validator-node/base_layer.{}.log" | ||
encoder: | ||
pattern: "{d(%Y-%m-%d %H:%M:%S.%f)} [{t}] [{X(node-public-key)},{X(node-id)}] {l:5} {m}{n} // {f}:{L} " | ||
|
||
# An appender named "base_layer" that writes to a file with a custom pattern encoder | ||
dan_layer: | ||
kind: rolling_file | ||
path: "log/validator-node/dan_layer.log" | ||
policy: | ||
kind: compound | ||
trigger: | ||
kind: size | ||
limit: 10mb | ||
roller: | ||
kind: fixed_window | ||
base: 1 | ||
count: 5 | ||
pattern: "log/validator-node/dan_layer.{}.log" | ||
encoder: | ||
pattern: "{d(%Y-%m-%d %H:%M:%S.%f)} [{t}] [{X(node-public-key)},{X(node-id)}] {l:5} {m}{n} // {f}:{L} " | ||
|
||
|
||
# An appender named "other" that writes to a file with a custom pattern encoder | ||
other: | ||
kind: rolling_file | ||
path: "log/validator-node/other.log" | ||
policy: | ||
kind: compound | ||
trigger: | ||
kind: size | ||
limit: 10mb | ||
roller: | ||
kind: fixed_window | ||
base: 1 | ||
count: 5 | ||
pattern: "log/validator-node/other.{}.log" | ||
encoder: | ||
pattern: "{d(%Y-%m-%d %H:%M:%S.%f)} [{t}] [Thread:{I}] {l:5} {m}{n} // {f}:{L} " | ||
|
||
# Set the default logging level to "info" | ||
root: | ||
level: warn | ||
appenders: | ||
- stdout | ||
|
||
loggers: | ||
# Route log events common to every application to all appenders | ||
|
||
tari::application: | ||
level: info | ||
appenders: | ||
- base_layer | ||
- network | ||
- other | ||
additive: false | ||
|
||
tari::validator_node: | ||
level: info | ||
appenders: | ||
- dan_layer | ||
- base_layer | ||
- network | ||
- other | ||
additive: false | ||
|
||
tari::dan_layer: | ||
level: info | ||
appenders: | ||
- dan_layer | ||
additive: false | ||
|
||
# Route log events sent to the "core" logger to the "base_layer" appender | ||
c: | ||
level: info | ||
appenders: | ||
- base_layer | ||
tari: | ||
level: info | ||
appenders: | ||
- base_layer | ||
|
||
# Route log events sent to the "wallet" logger to the "base_layer" appender | ||
wallet: | ||
level: info | ||
appenders: | ||
- base_layer | ||
# Route log events sent to the "comms" logger to the "network" appender | ||
comms: | ||
level: debug | ||
appenders: | ||
- network | ||
# Route log events sent to the "p2p" logger to the "network" appender | ||
p2p: | ||
level: debug | ||
appenders: | ||
- network | ||
|
||
# Route log events sent to the "yamux" logger to the "network" appender | ||
yamux: | ||
level: info | ||
appenders: | ||
- network | ||
# Route log events sent to the "mio" logger to the "network" appender | ||
mio: | ||
level: error | ||
appenders: | ||
- network | ||
# Route log events sent to the "rustyline" logger to the "other" appender | ||
rustyline: | ||
level: error | ||
appenders: | ||
- other | ||
additive: false | ||
|
||
# Route log events sent to the "tokio_util" logger to the "other" appender | ||
tokio_util: | ||
level: error | ||
appenders: | ||
- other | ||
# Route PGP log events | ||
pgp: | ||
level: warn | ||
appenders: | ||
- other | ||
# Route log events sent to the "tari_mm_proxy" logger to the "base_layer" appender | ||
tari_mm_proxy: | ||
level: info | ||
appenders: | ||
- base_layer | ||
# Route R2D2 log events | ||
r2d2: | ||
level: warn | ||
appenders: | ||
- other | ||
additive: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters