High-performance audit trail solution for tracking Doctrine entity changes. Built for compliance, optimized for speed, designed for developers.
composer require rcsofttech85/audit-trail-bundle
Enterprise-grade audit logging with minimal performance impact
Captures changes in onFlush, dispatches in postFlush. Non-blocking audits for maximum performance.
Store logs in your database, stream to external APIs (ELK, Splunk), or offload to queues (RabbitMQ, Redis).
Native sensitive data masking with #[SensitiveParameter] and #[Sensitive] attributes.
Roll back any entity to a previous state, including associations. Full change history at your fingertips.
Precisely tracks Many-to-Many and One-to-Many changes with exact IDs logged.
Automatically captures who made changes, including impersonation context.
Just add an attribute to start logging entity changes
use Rcsofttech85\AuditTrailBundle\Attribute\Auditable; use Rcsofttech85\AuditTrailBundle\Attribute\Sensitive; #[Auditable] class User { private string $email; #[Sensitive] // This field will be masked in logs private string $password; private string $name; }
AuditTrailBundle vs other popular Symfony audit solutions
| Feature | AuditTrailBundle | auditor (DamienHarper) | Loggable (Gedmo) |
|---|---|---|---|
| Split-phase architecture (non-blocking) | Same-transaction | ||
| Multiple transports (DB, HTTP, Queue) | DB only | ||
| Entity revert support | |||
| Sensitive data masking (GDPR) | |||
| Collection tracking (M2M, O2M) | |||
| Impersonation context tracking | User + IP | ||
| Doctrine DBAL 4.0+ / ORM 3.0+ support | DBAL 3.x only |
Information based on official documentation as of January 2026. Please verify with project repositories for the latest features.
Common questions about Symfony audit logging
An audit trail (or audit log) is a chronological record of all changes made to data in your application. AuditTrailBundle automatically tracks Doctrine entity changes including creates, updates, and deletes, storing who made the change, when, and what the previous and new values were.
Install AuditTrailBundle via Composer (composer require rcsofttech85/audit-trail-bundle), add the #[Auditable] attribute to your entities, and the bundle will automatically capture all changes during Doctrine flush operations using lifecycle events.
AuditTrailBundle uses a unique Split-Phase Architecture that captures changes in onFlush but defers dispatching to postFlush, resulting in minimal write overhead. It also supports multiple transports (Doctrine, HTTP, Queue), safe entity revert, and native GDPR-compliant data masking.
Yes! AuditTrailBundle provides safe revert support that allows you to roll back any entity to a previous state, including its associations. Use the CLI command or the programmatic API to revert changes at any point in history.
Yes! The bundle has built-in support for sensitive data masking using PHP's #[SensitiveParameter] attribute and a custom #[Sensitive] attribute. Masked fields are never stored in plain text in your audit logs.
AuditTrailBundle requires PHP 8.4+, Symfony 7.4+, and Doctrine ORM 3.0+. It's built for modern PHP applications using the latest language features and framework capabilities.
Start tracking entity changes in your Symfony application today.