Logger Parameters
This page explains the parameters related to logging operations of Iroha 2, as managed by the Logger module.
logger.compact
- Type: Boolean
- Default:
false
Use compact logging format.
Example:
[logger]
compact = true
TODO: give an example of compact and full logs. More clue in tracing Compact docs
logger.file
- Type: String
- Optional
If provided, logs will be copied to said file in the format readable by bunyan.
Example:
[logger]
file = "/usr/logs/iroha.jsonlogs"
Relative Paths
You can use relative paths. They will be resolved relative to the configuration file location:
# /home/iroha.toml
[logger]
file = "logs.jsonlogs" # will be `/home/logs.jsonlogs`
Standard Streams
Standard streams might be used as a destination as well:
[logger]
file = "/dev/stdout"
TODO: relative to CWD or to the config file?
TODO: which file extension should we use in examples? .jsonlogs
?
logger.level
Sets the logging sensitivity.
- ENV:
LOG
,LOG_LEVEL
,IROHA_LOG_LEVEL
- Type: String
- Possible Values:
TRACE
: All events, including low-level operations.DEBUG
: Debug-level messages, useful for diagnostics.INFO
: General informational messages.WARN
: Warnings that indicate potential issues.ERROR
: Errors that disrupt normal function but allow continued operation.FATAL
: Critical errors that lead to immediate termination.
- Default:
INFO
Choose the level that best suits your use case. Refer to Stack Overflow for additional details on how to use different log levels.
Example:
[logger]
level = "INFO"
LOG_LEVEL=INFO
logger.terminal_colors
- Type: Boolean
- Default:
true
Enable ANSI terminal colors for formatted output.
Example:
[logger]
terminal_colors = true