Docs / Reference / Commands

Commands

The console commands of the bundle: read, check, purge and set up the outputs.

Overview

CommandDoes
audit-log:listList entries, with pages and filters
audit-log:show <id>Show one entry with its full context
audit-log:purgeDelete old entries. Without --force, show how many it would delete
audit-log:setupCreate the storage of each output
audit-log:verifyCheck 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:

terminal
$ 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)
terminal
$ 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

audit-log:show

Show one entry with its full context. Give the UUID that audit-log:list shows:

terminal
$ bin/console audit-log:show 01a158b2-0deb-7198-9b1b-8a28b8380020

audit-log:purge

Delete the entries older than a duration. Without --force, the command only shows how many it would delete:

terminal
$ bin/console audit-log:purge --older-than="90 days"
$ bin/console audit-log:purge --older-than="90 days" --force

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:

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

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:

terminal
$ bin/console audit-log:verify
$ bin/console audit-log:verify --output=dbal

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.

ActionWritten byContext
READaudit-log:list, one page of the EasyAdmin listoutput, page, items_per_page, order, filters, count
READaudit-log:show, the EasyAdmin detail pageoutput, entry_id
VERIFYaudit-log:verifyoutput, checked, violations
PURGEaudit-log:purge --forceoutput, 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.