Production Ready | PHP 8.4+ | Symfony 7.4+

The #1 Symfony Audit Bundle for Enterprise

High-performance Doctrine entity tracking. Built for compliance, optimized for zero-overhead, and designed for modern Symfony applications.

composer require rcsofttech85/audit-trail-bundle
1.66ms
Audit Overhead
92%
Test Coverage
3
Transport Options
MIT
License

The Best Symfony Audit Trail Solution

Industry-leading features that outperform standard audit log libraries

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;
}

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