This package can be configured through various environment variables.
GOLOG_LOG_LEVEL
Specifies the log-level, both globally and on a per-subsystem basis.
For example, the following will set the global minimum log level to error, but reduce the minimum
log level for subsystem1 to info and reduce the minimum log level for subsystem2 to debug.
Setting onlyGOLOG_FILE will prevent logs from being written to standard error.
GOLOG_LOG_FMT
Specifies the log message format. It supports the following values:
color -- human readable, colorized (ANSI) output
nocolor -- human readable, plain-text output.
json -- structured JSON.
For example, to log structured JSON (for easier parsing):
export GOLOG_LOG_FMT="json"
The logging format defaults to color when the output is a terminal, and nocolor otherwise.
IPFS_LOGGING_FMT is a deprecated alias for this environment variable.
GOLOG_LOG_LABELS
Specifies a set of labels that should be added to all log messages as comma-separated key-value
pairs. For example, the following add {"app": "example_app", "dc": "sjc-1"} to every log entry.
请发表评论