Log

This is the config for event logs, which is optional and can not be reloaded. If set, the Root Value below must reside in the main conf file.

Root Value

The value could be a simple string, which is the driver name, such as

  • discard

    drop the logs. This is the default.

  • journal

    send logs to journald directly.

  • syslog

    send logs to syslogd directly.

  • stdout

    send logs to stdout.

    Added in version 0.3.5.

In such case, a default driver is used as default log config for all loggers.

The value could be a map, with the following keys:

  • default

    optional, type: log config

    Set default log config for loggers with no explicit config.

    default: discard

  • syslog

    optional, type: syslog

    Set default log config for loggers with no explicit config.

    default: not set

    Added in version 0.3.7.

  • fluentd

    optional, type: fluentd

    Set default log config for loggers with no explicit config.

    default: not set

    Added in version 0.3.7.

  • task

    optional, type: log config

    Set log config for task loggers.

    default: not set

Log Config Value

The detailed log config may be a simple driver name, or a map, with the following keys:

  • journal

    optional, type: map

    Use journal log driver. An empty map should be used, as no keys are defined by now.

  • syslog

    optional, type: syslog

    Use syslog log driver.

  • fluentd

    optional, type: fluentd

    Use fluentd log driver.

  • async_channel_size

    optional, type: usize

    Set the internal async channel size.

    default: 4096

  • async_thread_number

    optional, type: usize

    Set the number of async threads.

    This has no effect on discard and journal log driver.

    default: 1

  • io_error_sampling_offset

    optional, type: usize, max: 16

    The logger may encounter io error, we should report it anyhow. We will log this error every 2^n times, where n can be set here.

    This has no effect on discard and journal log driver.

    default: 10

Note

The discard driver has no config options, so it doesn’t has a corresponding map field.

Drivers