Skip to content

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:

toml
[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:

toml
[logger]
file = "/usr/logs/iroha.jsonlogs"

Relative Paths

You can use relative paths. They will be resolved relative to the configuration file location:

toml
# /home/iroha.toml
[logger]
file = "logs.jsonlogs" # will be `/home/logs.jsonlogs`

Standard Streams

Standard streams might be used as a destination as well:

toml
[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:

toml
[logger]
level = "INFO"
shell
LOG_LEVEL=INFO

logger.terminal_colors

  • Type: Boolean
  • Default: true

Enable ANSI terminal colors for formatted output.

Example:

toml
[logger]
terminal_colors = true