Production Ready | PHP 8.4+ | Symfony 7.4+

The Best Audit Log Bundle for Symfony

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
1.66ms
Audit Overhead
92%
Test Coverage
3
Transport Options
MIT
License

Why Choose AuditTrailBundle?

Enterprise-grade audit logging with minimal performance impact

Split-Phase Architecture

Captures changes in onFlush, dispatches in postFlush. Non-blocking audits for maximum performance.

Multiple Transports

Store logs in your database, stream to external APIs (ELK, Splunk), or offload to queues (RabbitMQ, Redis).

GDPR Compliant

Native sensitive data masking with #[SensitiveParameter] and #[Sensitive] attributes.

Safe Revert Support

Roll back any entity to a previous state, including associations. Full change history at your fingertips.

Deep Collection Tracking

Precisely tracks Many-to-Many and One-to-Many changes with exact IDs logged.

Impersonation Tracking

Automatically captures who made changes, including impersonation context.

Simple to Use

Just add an attribute to start logging entity changes

User.php PHP
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;
}

Feature Comparison

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.

Frequently Asked Questions

Common questions about Symfony audit logging

What is an audit trail in Symfony?

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.

How do I log entity changes in Doctrine?

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.

How is AuditTrailBundle different from DoctrineAuditBundle?

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.

Can I revert entity changes with AuditTrailBundle?

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.

Is AuditTrailBundle GDPR compliant?

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.

What PHP and Symfony versions are supported?

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.

Ready to Add Audit Logging?

Start tracking entity changes in your Symfony application today.

Get Started on GitHub Read Documentation