Docs / Outputs / Filesystem

Filesystem

Write the entries to a local file, one entry per line or element.

Overview

PackageReadsPurgeSetup
-NoNoYes

The output only writes. The commands and the EasyAdmin viewer cannot read it. See Outputs.

Enable the output

config/packages/symfonycorp_audit_log.yaml
symfonycorp_audit_log:
    outputs:
        filesystem:
            path: '%kernel.logs_dir%/audit.ndjson'
            formatter: json               # json, xml, csv, plaintext or a service id
            file_permissions: 0o600       # use the 0o prefix: YAML reads 0600 as a decimal number

Formatters

The json formatter writes one JSON object per line (NDJSON). xml, csv and plaintext write one element, row or line per entry. To write your own formatter, see Extend the bundle.

Create the file

audit-log:setup creates the directory and the file, and sets the mode of a new file. It does not change the mode of a file that exists:

terminal
$ bin/console audit-log:setup --output=filesystem

Retention

audit-log:purge does not work with this output. Set the retention yourself, for example with log rotation. To find the entries of one person, search the file or your log platform. See Retention.