Skip to content

logging

Key Type Default
logging.*
logging.level string WARN
logging.enable_stdout bool false
logging.include_app_name bool true
logging.include_app_version bool true
logging.log_json bool false

Log-file rotation, via the embedded timberjack logger: filename, maxsize, maxage, maxbackups, localtime, compression, rotationinterval, backuptimeformat, rotateatminutes, rotateat, appendtimeafterext, and filemode.

An unset filename means no log file is written and output goes to stdout instead. maxsize is in megabytes (default 100); maxage is in days (default: keep forever); maxbackups caps retained rotated files (default: keep all, subject to maxage); localtime uses local time rather than UTC in rotated filenames; compression is none, gzip, or zstd; rotationinterval is a duration forcing rotation on a schedule in addition to size. The rest tune backup filename formatting and rotation at specific times. See the DeRuina/timberjack package for the per-field detail.

string, default WARN

The minimum log level: a level name (debug, info, warn, error, case-insensitive, optionally with a numeric +N or -N offset) or a raw numeric slog level such as -4, 0, 4, or 8. An unrecognized or empty value falls back to info.

logging:
level: "WARN"

bool, default false

Also writes the main log to stdout even when a filename is set. When no filename is set, or the process is attached to a terminal, stdout is used regardless.

logging:
enable_stdout: false

bool, default true

Adds an “app” attribute, the string “ssoossh”, to every log record.

logging:
include_app_name: true

bool, default true

Adds a “version” attribute to every log record.

logging:
include_app_version: true

bool, default false

Writes JSON instead of text. Text is meant to be read, not parsed: the message is written as bare prose so quoted values in it are not escaped, which is not a machine-readable format. Set this wherever a log collector has to pull fields back out.

logging:
log_json: false