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 documentation of the AxoSyslog syslog-ng distribution.

For available macros like ${YEAR}/${MONTH}/${DAY} see the documentation of the AxoSyslog syslog-ng distribution.

Configuration

FileOutput

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

path (string, required)

Path where the file is stored.

persist_name (string, optional)

template (string, optional)

Last modified June 3, 2024: [4.6] Blog link fix (cc4602a)