This solution is separated into two sections:
Logging
The available log levels are:
- TRACE: the most-verbose logging level with maximum information
- INFO: Includes errors and informational messages
- WARN: Logs issues, but not other information
- ERROR: Logs error messages only
- FATAL: Logs only conditions that result in application failure
To adjust the log level permanently use the export command with either or both LEVEL variables:
export <variable>=<level>
Variable
|
Available Options
|
Purpose
|
BF_LOG_LEVEL
|
TRACE|INFO|WARN|ERROR|FATAL
|
The default global log level
|
BF_LOG_LEVEL_rpc_api
|
TRACE|INFO|WARN|ERROR|FATAL
|
RPC API subsystem log level
|
For example, the command to set the global log level to "INFO" is:
export BF_LOG_LEVEL=INFO
Logs are kept in the
.bitfusion subdirectory of the user’s home and in the system log:
~/.bitfusion/bf_Global.logand
/var/log/syslog (may vary depending on OS or version)
The variables will be read and used when Bitfusion is invoked and not mid-run, so the Bitfusion service will have to be restarted after adjusting the logging variables on any Bitfusion GPU server. This will cause a temporary interruption in Bitfusion services:
# systemctl restart bitfusion
Understanding the capture command
Bitfusion has a --capture option to the run command that can gather logs, traces, statistics and core dumps into a tarfile; and it lets you set the log level without explicitly setting the environmental variables discussed above. Here is an example:
bitfusion run –n 1 –-capture stats,tracing,logs:WARN ...
The capture option works as follows:
--capture <value>:<log level>
- value can be a comma-separated list (no whitespace) of the following key words
- logs, tracing, stats, and coredump.
- Alternately all can be selected by using the keyword: all.
- log level can take a specifier to set the log level:
- ERROR, WARN, INFO, TRACE, DEBUG.
- Note: If you use all for the value, you cannot set the log level.