Skip to content

Read and Configure AionR Logs

MiaoShi09 edited this page Jan 24, 2019 · 3 revisions

AionR logs help you debug issues. This wiki page explains:

How to Read Log

Log Format

For default setting, Kernel prints logs in the format like:

> 2019-01-23 13:08:25 Staged blocks from 512 to 558 with parent: 088d…01c9
# |--- timestamp ---| |----------------- Log Message ---------------------|

If the log level is lower than info, Kernel will print logs in the format like:

> 2019-01-23 12:55:08 tokio-runtime-worker-2  INFO    sync      line:142     Best block number: 0, hash: 0989…a94f
# |--- timestamp ---| |---- thread_name ---| |level| |target| |log_location| |------------ log_message ------------|

Log Header Info

When AionR launches, it prints a list of info: Log Header

Configure AionR Logs

Write Log to a File

By default, AionR only prints the log in the terminal. If you want to write the Kernel log into a file, you can

  • edit the configuration:
[log]
log_file = "output/file/path"
  • or launch AionR with option --log-file=[FILENAME] , e.g. ./mainnet.sh --log-file=mainnet/mainnet.log

Edit Log Level

There are 5 log levels in AionR:

  • error: Critical issues that lead to application hanging
  • warn: The issues does not hangup to the application operations but should need a high attention to.
  • info: Generally useful information
  • debug: Information that is diagnostically helpful to people more than just developers
  • trace: Development and issue investigation aided log You can configure all modules(targets) log level in the configuration:
[log]
level = "info" # "info" is the default value

If you encounter a problem and want to set a specific module(target) to a lower level, you can add the module(target) name and the log level into configuration targets in [log] section.

[log]
# targets=["<target_name>=<log_level>",..,], 
# e.g. set transaction queue log to trace and fastVM log to debug
targets=["txqueue=trace","vm=debug"]

The list of module(target) name can be found in Log Targets.

Clone this wiki locally