Commands
The console commands of the bundle: read, check, purge and set up the outputs.
Overview
| Command | Does |
|---|---|
audit-log:list | List entries, with pages and filters |
audit-log:show <id> | Show one entry with its full context |
audit-log:purge | Delete old entries. Without --force, show how many it would delete |
audit-log:setup | Create the storage of each output |
audit-log:verify | Check the integrity hashes. Needs integrity |
The list, show and verify commands use the readable outputs: dbal, elasticsearch, mongodb and in_memory. purge uses the outputs that support purge. If you have more than one output that can do the job, add --output=<name>. Each command exits with a non-zero code on an error.
audit-log:list
List the entries, newest first:
$ bin/console audit-log:list
-------------------------------------- -------------- -------- ---------------------------------- ---------------------
Id Source Action Message Timestamp
-------------------------------------- -------------- -------- ---------------------------------- ---------------------
01a158b2-0deb-7198-9b1b-8a28b8380020 doctrine_orm INSERT Entity "App\Entity\Book" created 2026-10-20 09:43:46
-------------------------------------- -------------- -------- ---------------------------------- ---------------------
Showing 1 entry (page=1, items-per-page=50, order=DESC)$ bin/console audit-log:list --source=doctrine_orm --action=UPDATE
$ bin/console audit-log:list --from="2026-03-01" --to="2026-03-31" --page=2 --items-per-page=20
$ bin/console audit-log:list --order=ASC # oldest first. Default: DESC--source: keep the entries of this source.--action: keep the entries of this action.--from,--to: keep the entries at or after, at or before this date, for example"2026-03-01".--order:ASC(oldest first) orDESC(newest first). Default:DESC.--page: the page number, from 1. Default: 1.--items-per-page: the number of entries per page. Default: 50. Maximum: 1000.--output: the output to read.
audit-log:show
Show one entry with its full context. Give the UUID that audit-log:list shows:
$ bin/console audit-log:show 01a158b2-0deb-7198-9b1b-8a28b8380020id: the UUID of the entry. Required.--output: the output to read.
audit-log:purge
Delete the entries older than a duration. Without --force, the command only shows how many it would delete:
$ bin/console audit-log:purge --older-than="90 days"
$ bin/console audit-log:purge --older-than="90 days" --force--older-than: the age of the entries to delete, for example"90 days","6 months"or"1 year". Required.--force: delete the entries.--output: the output to purge. The command purges one output per run.
Run it on a schedule. See Retention.
audit-log:setup
Create the table, index, collection or file of each output. The command does not change a storage that exists:
$ bin/console audit-log:setup
$ bin/console audit-log:setup --output=dbal--output: set up only this output. Repeat the option for more than one output. Default: all the outputs.
See Create the storage.
audit-log:verify
Check the integrity hash of each stored entry. The command exists only when integrity is enabled. It exits with a non-zero code when it finds a violation:
$ bin/console audit-log:verify
$ bin/console audit-log:verify --output=dbal--output: the output to check.
See Integrity.
Access to the entries
The commands and the EasyAdmin viewer record each read, check and purge in an entry with the audit_log source. You cannot disable it.
| Action | Written by | Context |
|---|---|---|
READ | audit-log:list, one page of the EasyAdmin list | output, page, items_per_page, order, filters, count |
READ | audit-log:show, the EasyAdmin detail page | output, entry_id |
VERIFY | audit-log:verify | output, checked, violations |
PURGE | audit-log:purge --force | output, before, deleted |
Enable the user context provider to know who read the entries. The PHP reader does not record a read.
Maker commands
With symfony/maker-bundle, the make:audit-source, make:audit-output, make:audit-reader, make:audit-formatter, make:audit-context-provider and make:audit-transformer commands generate your own classes. See Extend the bundle.