File

The file output stores log records in a plain text file.

  spec:
    file:
      path: /mnt/archive/logs/${YEAR}/${MONTH}/${DAY}/app.log
      create_dirs: true

For details on the available options of the output, see the syslog-ng documentation.

path (string, required)

Store file path

Default: -

create_dirs (bool, optional)

Enable creating non-existing directories.

Default: false

dir_group (string, optional)

The group of the directories created by syslog-ng. To preserve the original properties of an existing directory, use the option without specifying an attribute: dir-group().

Default: Use the global settings

dir_owner (string, optional)

The owner of the directories created by syslog-ng. To preserve the original properties of an existing directory, use the option without specifying an attribute: dir-owner().

Default: Use the global settings

dir_perm (int, optional)

The permission mask of directories created by syslog-ng. Log directories are only created if a file after macro expansion refers to a non-existing directory, and directory creation is enabled (see also the create-dirs() option). For octal numbers prefix the number with 0, for example use 0755 for rwxr-xr-x.

Default: Use the global settings

disk_buffer (*DiskBuffer, optional)

This option enables putting outgoing messages into the disk buffer of the destination to avoid message loss in case of a system failure on the destination side. For details, see the Syslog-ng DiskBuffer options.

Default: false

template (string, optional)

Default: -

persist_name (string, optional)

Default: -