Log
This section describes event-log configuration. It is optional and cannot be reloaded. If present, the root value must be defined in the main configuration file.
The section may also be set to YAML null to leave the built-in defaults in
place.
Root Value
The root value can be a simple string naming the log driver, for example:
discard
Drop all logs. This is the default.
journal
Send logs directly to journald.
syslog
Send logs directly to syslogd.
stdout
Send logs to standard output.
Added in version 1.9.8.
In this form, the selected driver becomes the default configuration for all loggers.
The root value can also be a map with the following keys:
default
optional, type: log config
Default log configuration for loggers without an explicit override.
default: discard
syslog
optional, type: syslog
Shorthand for making
syslogthe default logger configuration for all log categories.default: not set
Added in version 1.11.0.
fluentd
optional, type: fluentd
Shorthand for making
fluentdthe default logger configuration for all log categories.default: not set
Added in version 1.11.0.
task
optional, type: log config
Log configuration for task loggers.
default: not set
escape
optional, type: log config
Log configuration for escape loggers.
default: not set
resolve
optional, type: log config
Log configuration for resolve loggers.
default: not set
audit
optional, type: log config
Log configuration for audit loggers.
default: not set
Log Config Value
Each detailed log configuration can be either a simple driver name or a map with the following keys:
journal
optional, type: map
Use the
journallog driver. The map is currently empty because there are no driver-specific keys.syslog
optional, type: syslog
Use the
sysloglog driver.fluentd
optional, type: fluentd
Use the
fluentdlog driver.async_channel_size
optional, type: usize
Size of the internal async channel.
default: 4096
async_thread_number
optional, type: usize
Number of async worker threads.
This setting has no effect for the
discardandjournaldrivers.default: 1
io_error_sampling_offset
optional, type: usize, max: 16
Loggers may encounter repeated I/O errors. This setting controls exponential sampling of those errors: an error is logged every
2^noccurrences, wherenis the configured value.This setting has no effect for the
discardandjournaldrivers.default: 10
Note
The discard driver has no configuration options, so it has no
corresponding map field.
Example:
log:
default:
syslog:
target_udp: 192.0.2.20:514
format_rfc5424:
enterprise_id: 32473
async_channel_size: 8192
task: stdout
audit:
fluentd:
address: 127.0.0.1:24224