Symfony audit bundle for fast, reliable Doctrine audit logging.
AuditTrailBundle records Doctrine ORM entity changes, entity history, and access events so
teams can build a reliable Symfony audit log for admin panels, compliance reviews, and
recovery. By default it captures changes during flush and sends audits after
postFlush so normal writes stay fast, while still giving you stricter
delivery options when you need them.
composer require rcsofttech/audit-trail-bundle
# Optional packages
composer require symfony/messenger
composer require symfony/http-client
composer require easycorp/easyadmin-bundle
PHP 8.4+
Built for modern PHP and current Symfony projects rather than older compatibility layers.
Symfony 7.4+
Supports Symfony 7.4+ and 8.0+ with Doctrine ORM 3.6+ requirements documented in the README.
3 transports
Database, HTTP, and queue delivery options let the bundle fit different operational needs.
Deferred by default
Capture happens during flush, while delivery runs after postFlush unless you
choose stricter behavior.
Why this Symfony audit bundle is different.
AuditTrailBundle is positioned around Doctrine-safe delivery, transport flexibility, audit integrity, access auditing, and operational clarity rather than just "log everything" behavior.
Split-phase architecture
Instead of pushing everything through one step, the bundle splits capture, delivery, and persistence so Symfony audit logging fits Doctrine flush rules better.
Multiple transports
Choose database, HTTP, or queue transports depending on whether you want local persistence, remote delivery, or async processing.
Sensitive data masking
Supports native #[SensitiveParameter] and custom #[Sensitive]
attributes to help keep audit payloads safer.
Access auditing
Tracks sensitive entity read operations with built-in request deduplication and optional cooldowns across requests.
Conditional auditing
Use ignored properties and runtime conditions to reduce noisy audit logs and keep entity history easier to review.
Collection change tracking
Tracks to-many collection changes so your Doctrine audit logging does not stop at simple scalar diffs or partial entity history.
Revert and recovery
Includes revert support and dedicated documentation for recovery workflows instead of treating audit logs as write-only history.
Profiler and admin UI
Includes Symfony profiler support and EasyAdmin integration for audit review and operational visibility.
Designed for Doctrine audit logging that respects the write path.
If you are evaluating a Symfony audit bundle or looking for an auditor-bundle alternative, this is the operational difference that matters most: capture and delivery are not forced into one brittle step.
- Capture changes during Doctrine
onFlush. - Keep ORM-safe work inside the right part of the flush lifecycle.
- Dispatch audits after
postFlushby default so normal writes stay lighter. - Use a separate writer for deferred database writes instead of calling nested
flush()insidepostFlush.
What production setups usually care about
- Deferred delivery by default for lighter write pressure.
- Option to keep stricter behavior when your audit and write must succeed together.
- Failure handling and fallback behavior documented for HTTP and queue transport flows.
- UUID v7 ordering and audit-reader constraints documented for operational safety.
Quick start for this Symfony audit bundle.
composer require rcsofttech/audit-trail-bundle php bin/console make:migration php bin/console doctrine:migrations:migrate
use Rcsofttech\AuditTrailBundle\Attribute\Auditable; #[Auditable(ignoredProperties: ['internalCode'])] class Product { // Track Doctrine entity changes and skip noisy fields }
Built for audit integrity, not just audit storage.
AuditTrailBundle can help with tamper detection, review, and safer payload handling alongside normal Symfony audit log capture.
HMAC signatures
Audit logs and transport payloads can be signed so tampering can be detected during verification.
Integrity verification
Command-line tools are available to audit your audit logs rather than assuming log rows were left untouched.
Request and user context
Track context that matters during review, including request and user-level audit data.
Common use cases for Symfony audit logging.
In practice, teams adopt Symfony audit logging for seven recurring jobs: entity history, admin accountability, read-access monitoring, compliance review, recovery, and transport-safe delivery. AuditTrailBundle is built around those real workflows.
Track who changed what and when
Use this Symfony audit log bundle when your back-office or admin system needs a reliable history of entity changes, including request context, user context, and change details that help during support investigations.
Give internal teams a clearer admin audit trail
EasyAdmin integration and Symfony profiler support make it easier to review audit logs during support, debugging, and operational investigations instead of leaving history buried in raw database tables.
Keep a cleaner audit trail for review workflows
For teams dealing with compliance logging, internal review, or regulated data flows, AuditTrailBundle supports sensitive data masking, audit integrity signing, and verification tooling instead of leaving review as an afterthought.
Monitor sensitive read access, not only writes
Some teams need a Symfony audit log that records who viewed sensitive data as well as who changed it. Access auditing helps cover that gap with request-level deduplication and optional cooldown behavior.
Recover from bad writes and mistaken admin actions
Doctrine audit logging becomes much more useful when it also supports recovery. The bundle's revert and recovery features help when a bad import, incorrect update, or accidental change needs to be understood and rolled back safely.
Keep audit history cleaner with conditional logging
Conditional auditing and ignored properties help reduce audit noise from fields that do not matter during review, which keeps change history more useful for support and compliance work.
Match audit delivery to your production architecture
Some teams want local database persistence, some need remote HTTP delivery, and others want queue-based async processing. AuditTrailBundle supports database, HTTP, and queue transports so your Symfony audit bundle can fit the way your application actually runs.
Frequently asked questions about AuditTrailBundle.
These FAQs focus on the actual product behavior developers usually want to confirm before installing a Symfony audit bundle.
It is a Symfony audit bundle for Doctrine ORM entity change tracking.
AuditTrailBundle records Doctrine ORM entity changes and stores audit logs, with a design that keeps normal writes lighter by default.
It avoids unsafe nested flush behavior in postFlush.
Deferred database writes use a separate writer rather than calling flush()
from inside Doctrine postFlush.
Database, HTTP, and queue transports are supported.
Symfony Messenger can support async database or queue transport flows, while Symfony HttpClient can support HTTP delivery.
Yes, both sensitive data masking and revert workflows are included.
The package documentation also covers recovery, integrity signing, verification, request context, and EasyAdmin / profiler integration.
Yes, it can audit sensitive read operations as well as write changes.
The bundle includes access auditing with request-level deduplication and optional cooldown support for cross-request review workflows.
Yes, conditional auditing and ignored properties help keep history cleaner.
You can skip unnecessary fields and apply runtime rules so your Symfony audit log stays more useful during admin review, support, and compliance checks.
Install AuditTrailBundle and explore the full docs.
AuditTrailBundle is a strong fit for teams that need a Symfony audit bundle with Doctrine-safe delivery, transport flexibility, audit integrity support, and practical recovery workflows.