Filesystem
Write the entries to a local file, one entry per line or element.
Overview
| Package | Reads | Purge | Setup |
|---|---|---|---|
| - | No | No | Yes |
The output only writes. The commands and the EasyAdmin viewer cannot read it. See Outputs.
Enable the output
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 numberpath: the file of the entries. This option is required.formatter:json,xml,csv,plaintextor the service id of your ownFormatterInterface. Default:json.file_permissions: the mode of the file when the bundle creates it. Default:0o600. Use the0oprefix: YAML reads0600as 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:
$ bin/console audit-log:setup --output=filesystemRetention
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.