<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: rahul chavan</title>
    <description>The latest articles on DEV Community by rahul chavan (@rahul_chavan_fa70c3ea3f79).</description>
    <link>https://dev.to/rahul_chavan_fa70c3ea3f79</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3709153%2Fbbf81f63-1ad7-45c7-bdc5-8efb4e2ec559.png</url>
      <title>DEV Community: rahul chavan</title>
      <link>https://dev.to/rahul_chavan_fa70c3ea3f79</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rahul_chavan_fa70c3ea3f79"/>
    <language>en</language>
    <item>
      <title>5 Features That Make AuditTrailBundle Stand Out</title>
      <dc:creator>rahul chavan</dc:creator>
      <pubDate>Fri, 10 Apr 2026 14:14:52 +0000</pubDate>
      <link>https://dev.to/rahul_chavan_fa70c3ea3f79/5-features-that-make-audittrailbundle-stand-out-28mn</link>
      <guid>https://dev.to/rahul_chavan_fa70c3ea3f79/5-features-that-make-audittrailbundle-stand-out-28mn</guid>
      <description>&lt;p&gt;Most Symfony audit bundles solve the same core problem: record Doctrine entity changes and let you inspect history later. Where &lt;a href="https://github.com/rcsofttech85/AuditTrailBundle" rel="noopener noreferrer"&gt;AuditTrailBundle&lt;/a&gt; starts to separate itself is in the places where many audit packages stop: transport strategy, integrity guarantees, read-access logging, and recovery workflow.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Read-access auditing, not just write auditing&lt;br&gt;
Most Doctrine audit tools focus on inserts, updates, deletes, and association changes. AuditTrailBundle goes further by documenting #[AuditAccess] for entity read tracking, including deduplication with a configurable cooldown. That is a meaningful distinction for teams working on privacy, insider-access monitoring, or regulated data access trails.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Multiple built-in transport targets&lt;br&gt;
AuditTrailBundle is not framed as “database audit tables only.” Its docs explicitly present three delivery targets: Database[sync+async support], HTTP, and Queue/Messenger. That changes how you think about the bundle. It can act as an in-app audit logger, an integration point for external observability/compliance systems, or a queue-first pipeline.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cryptographic integrity verification&lt;br&gt;
A lot of audit libraries help you answer “what changed?” Fewer help you answer “can I prove this audit record was not tampered with?” AuditTrailBundle documents HMAC signing and integrity verification tooling, which pushes it closer to compliance-grade audit design rather than simple change history.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Split-phase audit architecture&lt;br&gt;
One of the more technically interesting parts of AuditTrailBundle is that it explicitly documents a split-phase model: capture during onFlush, then dispatch during postFlush. That is not just implementation detail. It reflects a deliberate position on Doctrine lifecycle safety, write-path latency, and transport behavior.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Built-in revert and recovery workflow&lt;br&gt;
AuditTrailBundle also distinguishes itself by documenting “Safe Revert Support” and dedicated revert/recovery guidance. That shifts the product from pure audit visibility toward operational remediation. In other words, it is not only about reading the past, but also about using that history to recover state.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Closing thought&lt;br&gt;
What stands out about AuditTrailBundle is not that it audits Doctrine entities. Several bundles do that well. What stands out is that it treats auditing as a system design problem: capture timing, delivery strategy, tamper evidence, read access, and recovery all matter.&lt;/p&gt;

&lt;p&gt;If AuditTrailBundle is useful to you, you can support the project by sharing feedback, starring the repository, reporting issues, or contributing pull requests.&lt;/p&gt;

</description>
      <category>symfony</category>
      <category>php</category>
    </item>
    <item>
      <title>From Personal Tool to Open Source: Console Profiler Bundle</title>
      <dc:creator>rahul chavan</dc:creator>
      <pubDate>Wed, 25 Mar 2026 12:17:26 +0000</pubDate>
      <link>https://dev.to/rahul_chavan_fa70c3ea3f79/from-personal-tool-to-open-source-console-profiler-bundle-2gk0</link>
      <guid>https://dev.to/rahul_chavan_fa70c3ea3f79/from-personal-tool-to-open-source-console-profiler-bundle-2gk0</guid>
      <description>&lt;p&gt;Hey everyone! 👋&lt;/p&gt;

&lt;p&gt;If there's one thing I've learned from using Symfony since version 2, it's that as your application scales, so do your hidden bottlenecks. Over the years, I've built dozens of little utilities and scripts for my personal use cases to help debug long-running console queue workers, heavy data imports, and nightly cron jobs. &lt;/p&gt;

&lt;p&gt;Recently, I looked back at some of these tools and realized they could be incredibly helpful to the broader community. So, I took one of my tools, completely modernized it for PHP 8.4 and Symfony 8.0, and decided to open-source it. &lt;/p&gt;

&lt;p&gt;I'm excited to share the &lt;strong&gt;Console Profiler Bundle&lt;/strong&gt; with you all.&lt;/p&gt;

&lt;h3&gt;
  
  
  But Why Another Profiler?
&lt;/h3&gt;

&lt;p&gt;The standard Symfony Web Profiler is absolutely amazing for HTTP requests. It's the gold standard. But what happens when you run a heavy queue worker (&lt;code&gt;messenger:consume&lt;/code&gt;) and you want to know if it's leaking memory? What if a CLI sync command is hammering your database with N+1 queries in the background? &lt;/p&gt;

&lt;p&gt;You typically have to pepper your code with &lt;code&gt;memory_get_usage()&lt;/code&gt; dumps or &lt;code&gt;echo "Running query..."&lt;/code&gt;, which is tedious and messy. &lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Console Profiler Bundle&lt;/strong&gt; solves this by hooking right into your terminal and giving you a live, auto-refreshing &lt;br&gt;
&lt;strong&gt;TUI&lt;/strong&gt; while your commands are actually running.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwmleaf3j6jzud885a4sw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwmleaf3j6jzud885a4sw.png" alt=" " width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Key Features
&lt;/h3&gt;

&lt;p&gt;I wanted this bundle to be as zero-config and plug-and-play as possible while providing deep insights. Here’s what it tracks for you in real time:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Memory Tracking:&lt;/strong&gt; Live memory usage, peak memory, and even a live growth rate indicator (&lt;code&gt;+X MB/s&lt;/code&gt;). If you see a steady red upward trend, you know you've got a memory leak.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;SQL Query Counting:&lt;/strong&gt; Zero-config automatic SQL query counting via Doctrine DBAL 4 Middleware. It tracks exactly how many queries your command is making in real time.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;CPU Time:&lt;/strong&gt; Tracks both user and system CPU time via &lt;code&gt;getrusage()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Performance Trends:&lt;/strong&gt; Real-time trend indicators (&lt;code&gt;↑&lt;/code&gt; &lt;code&gt;↓&lt;/code&gt; &lt;code&gt;→&lt;/code&gt;) for both memory and SQL queries so you can spot spikes instantly.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;JSON Profiler Export:&lt;/strong&gt; You can optionally dump a JSON report at the end of the command. I use this heavily in CI pipelines to automatically fail builds if a CLI N+1 regression sneaks in!&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  The Journey to Open Source
&lt;/h3&gt;

&lt;p&gt;Moving from a "personal hack" to an open-source library was an eye-opening experience. I had to rip out a lot of hardcoded assumptions and ensure the codebase adheres strictly to modern standards. &lt;/p&gt;

&lt;p&gt;Modernizing the code to leverage the features of PHP 8.4 and Symfony 8 was a blast, and honestly, seeing the live terminal dashboard update smoothly feels like magic. I also made sure the TUI degrades gracefully when &lt;code&gt;ext-pcntl&lt;/code&gt; isn't available.&lt;/p&gt;
&lt;h3&gt;
  
  
  Try It Out!
&lt;/h3&gt;

&lt;p&gt;If you are running PHP 8.4+ and Symfony 8.0+, you can load it in as a dev dependency right now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require &lt;span class="nt"&gt;--dev&lt;/span&gt; rcsofttech/console-profiler-bundle
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It works out of the box—just run any console command like &lt;code&gt;bin/console messenger:consume async&lt;/code&gt; and look at the top of your terminal.&lt;/p&gt;

&lt;p&gt;If you don't use it or want to turn it off, it gracefully steps aside. Oh, and it's smart enough to turn itself off in production!&lt;/p&gt;

&lt;p&gt;You can find the repo here: &lt;a href="https://github.com/rcsofttech85/ConsoleProfilerBundle" rel="noopener noreferrer"&gt;rcsofttech85/ConsoleProfilerBundle&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  I Need Your Feedback!
&lt;/h3&gt;

&lt;p&gt;Since this is my transition from keeping things internal to releasing them to the world, I would absolutely love to hear your thoughts. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does this solve a problem you face with Symfony console commands?&lt;/li&gt;
&lt;li&gt;Are there specific metrics you wish were tracked in the terminal?&lt;/li&gt;
&lt;li&gt;Do you like the TUI layout?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please drop a comment below or open an issue/PR on GitHub. Your feedback is what will shape the future of this tool. Let's build better CLIs together! 🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>symfony</category>
      <category>php</category>
    </item>
    <item>
      <title>AuditTrailBundle now includes a Symfony Web Profiler integration, allowing developers to inspect audit logs recorded during a request directly from the debug toolbar and profiler panel.
https://github.com/rcsofttech85/AuditTrailBundle</title>
      <dc:creator>rahul chavan</dc:creator>
      <pubDate>Fri, 20 Mar 2026 06:12:27 +0000</pubDate>
      <link>https://dev.to/rahul_chavan_fa70c3ea3f79/audittrailbundle-now-includes-a-symfony-web-profiler-integration-allowing-developers-to-inspect-4hlj</link>
      <guid>https://dev.to/rahul_chavan_fa70c3ea3f79/audittrailbundle-now-includes-a-symfony-web-profiler-integration-allowing-developers-to-inspect-4hlj</guid>
      <description>&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://github.com/rcsofttech85/AuditTrailBundle" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fopengraph.githubassets.com%2Fd6cf5e8d874ed7695c87a2a6807f0beba154ad5ad052cc655fe536e9ee4a59bd%2Frcsofttech85%2FAuditTrailBundle" height="600" class="m-0" width="1200"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://github.com/rcsofttech85/AuditTrailBundle" rel="noopener noreferrer" class="c-link"&gt;
            GitHub - rcsofttech85/AuditTrailBundle: High-performance Symfony audit logging for Doctrine ORM. Async-ready, cryptographically signed, and optimized for enterprise compliance without the database overhead. · GitHub
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            High-performance Symfony audit logging for Doctrine ORM. Async-ready, cryptographically signed, and optimized for enterprise compliance without the database overhead. - rcsofttech85/AuditTrailBundle
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.githubassets.com%2Ffavicons%2Ffavicon.svg" width="32" height="32"&gt;
          github.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Dispatching Audit Logs Asynchronously for Maximum Performance</title>
      <dc:creator>rahul chavan</dc:creator>
      <pubDate>Tue, 24 Feb 2026 06:48:10 +0000</pubDate>
      <link>https://dev.to/rahul_chavan_fa70c3ea3f79/dispatching-audit-logs-asynchronously-for-maximum-performance-2haa</link>
      <guid>https://dev.to/rahul_chavan_fa70c3ea3f79/dispatching-audit-logs-asynchronously-for-maximum-performance-2haa</guid>
      <description>&lt;p&gt;Audit logging is the backbone of any enterprise application. Whether you are building a healthcare portal, a fintech app, or an internal CRM where tracking "who did what and when" is legally mandated, audit logs are non-negotiable.&lt;/p&gt;

&lt;p&gt;However, adding an audit trail often introduces a massive performance penalty. By default, every time you flush an entity in Doctrine, the audit system must compute change-sets, serialize old and new data, and execute additional &lt;code&gt;INSERT&lt;/code&gt; statements to your database. In a high-traffic Symfony API, synchronous auditing can easily double your response times.&lt;/p&gt;

&lt;p&gt;we're going to fix that. We will learn how to dispatch audit logs asynchronously using Symfony Messenger and the &lt;strong&gt;&lt;a href="https://github.com/rcsofttech85/AuditTrailBundle" rel="noopener noreferrer"&gt;AuditTrailBundle&lt;/a&gt;&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;If you are looking for the best &lt;strong&gt;Symfony audit log&lt;/strong&gt; solution that doesn't sacrifice performance, this is for you.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Synchronous Bottleneck
&lt;/h2&gt;

&lt;p&gt;Before we optimize, let's understand the problem. In traditional audit logging, the lifecycle looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You create or update a &lt;code&gt;Product&lt;/code&gt; entity.&lt;/li&gt;
&lt;li&gt;You call &lt;code&gt;$entityManager-&amp;gt;flush()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;An &lt;code&gt;onFlush&lt;/code&gt; or &lt;code&gt;postFlush&lt;/code&gt; listener intercepts the operation.&lt;/li&gt;
&lt;li&gt;The listener builds an &lt;code&gt;AuditLog&lt;/code&gt; entity (computes diffs, extracts user context, grabs IP addresses).&lt;/li&gt;
&lt;li&gt;The listener forces &lt;em&gt;another&lt;/em&gt; synchronous &lt;code&gt;INSERT&lt;/code&gt; into the database.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In our internal benchmarks using an in-memory SQLite database, a standard synchronous Doctrine flush with audit logging takes &lt;code&gt;~10.2ms&lt;/code&gt;. In a real-world scenario with a networked relational database (MySQL/PostgreSQL), network latency can easily push this to &lt;strong&gt;30-50ms per request&lt;/strong&gt;. And if you are doing bulk inserts? The latency stacks up quickly.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: Asynchronous Queue Transport
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;&lt;a href="https://github.com/rcsofttech85/AuditTrailBundle" rel="noopener noreferrer"&gt;AuditTrailBundle&lt;/a&gt;&lt;/strong&gt;  solves this elegantly using a &lt;strong&gt;Split-Phase Architecture&lt;/strong&gt; and native support for Symfony Messenger. &lt;/p&gt;

&lt;p&gt;Instead of waiting for the database to write the audit log, the bundle serializes the audit data into an &lt;code&gt;AuditLogMessage&lt;/code&gt; and pushes it to a message queue (like RabbitMQ, Redis, or Doctrine). A background worker then processes the queue, validating the integrity of the log and inserting it into the database.&lt;/p&gt;

&lt;p&gt;By offloading the I/O operations to a worker, your main user request finishes instantly.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step-by-Step Guide: Implementing Async Symfony Audit Logs
&lt;/h2&gt;

&lt;p&gt;Here is how you can set up asynchronous audit logging in your Symfony application in under 5 minutes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Install the Bundle
&lt;/h3&gt;

&lt;p&gt;First, install the &lt;code&gt;rcsofttech/audit-trail-bundle&lt;/code&gt; via Composer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require rcsofttech/audit-trail-bundle
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Configure Symfony Messenger
&lt;/h3&gt;

&lt;p&gt;Before enabling the async transport, ensure you have a transport configured in Symfony Messenger. Let's create an &lt;code&gt;audit_trail&lt;/code&gt; transport in &lt;code&gt;config/packages/messenger.yaml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;framework&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;messenger&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;transports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="c1"&gt;# We use an async transport (e.g., AMQP, Redis, or Doctrine)&lt;/span&gt;
            &lt;span class="na"&gt;audit_trail&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;%env(MESSENGER_TRANSPORT_DSN)%'&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Enable the Queue Transport
&lt;/h3&gt;

&lt;p&gt;Now, tell the AuditTrailBundle to use the queue transport instead of the default synchronous Doctrine transport. Update your &lt;code&gt;config/packages/audit_trail.yaml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;audit_trail&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;transports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# Disable the default synchronous transport&lt;/span&gt;
        &lt;span class="na"&gt;doctrine&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; 

        &lt;span class="c1"&gt;# Enable the async queue transport&lt;/span&gt;
        &lt;span class="na"&gt;queue&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
            &lt;span class="c1"&gt;# Optional: Specify a custom bus if you use multiple message buses&lt;/span&gt;
            &lt;span class="na"&gt;bus&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;messenger.bus.default'&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Run the Consumer
&lt;/h3&gt;

&lt;p&gt;In your production or local environment, start the Messenger worker to consume the audit messages in the background:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php bin/console messenger:consume audit_trail &lt;span class="nt"&gt;-vv&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it! Your Symfony application is now dispatching audit logs asynchronously.&lt;/p&gt;




&lt;h2&gt;
  
  
  Under the Hood: How it Works
&lt;/h2&gt;

&lt;p&gt;Let's look at the technical architecture of how &lt;code&gt;AuditTrailBundle&lt;/code&gt; achieves this.&lt;/p&gt;

&lt;p&gt;When you flush your &lt;code&gt;EntityManager&lt;/code&gt;, the &lt;code&gt;EntityProcessor&lt;/code&gt; captures the raw changes and delegates the dispatch to the &lt;code&gt;AuditDispatcher&lt;/code&gt;. If the Queue transport is enabled, the &lt;code&gt;QueueAuditTransport&lt;/code&gt; takes over.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Message Creation
&lt;/h3&gt;

&lt;p&gt;The bundle prevents heavy ORM entity serialization by transforming the raw &lt;code&gt;AuditLog&lt;/code&gt; into a lightweight, decoupled &lt;code&gt;AuditLogMessage&lt;/code&gt; DTO:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AuditLogMessage&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;createFromAuditLog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$log&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$entityId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Extensibility via Events
&lt;/h3&gt;

&lt;p&gt;Before the message is dispatched to the bus, the bundle fires an &lt;code&gt;AuditMessageStampEvent&lt;/code&gt;. This allows you to programmatically attach Messenger stamps (like a &lt;code&gt;DelayStamp&lt;/code&gt; or custom routing rules) to the audit log without overriding core services.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Example: Adding a 5-second delay to all audit logs&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;onAuditMessageStamp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;AuditMessageStampEvent&lt;/span&gt; &lt;span class="nv"&gt;$event&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$event&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;addStamp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DelayStamp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Cryptographic Signatures (HMAC)
&lt;/h3&gt;

&lt;p&gt;If you have data integrity enabled (&lt;code&gt;audit_trail.integrity.enabled: true&lt;/code&gt;), the bundle signs the JSON payload of the message and attaches a &lt;code&gt;SignatureStamp&lt;/code&gt;. When the worker consumes the message, it verifies the signature to ensure the audit log wasn't tampered with while sitting in the queue (e.g., Redis or RabbitMQ).&lt;/p&gt;




&lt;h2&gt;
  
  
  Hard Data: The Benchmarks
&lt;/h2&gt;

&lt;p&gt;Does async logging actually make a difference? We ran rigorous automated benchmarks using &lt;code&gt;PHPBench&lt;/code&gt; to measure the throughput of the &lt;code&gt;QueueAuditTransport&lt;/code&gt; against the synchronous Doctrine approach.&lt;/p&gt;

&lt;p&gt;Here are the results:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Worker Throughput&lt;/strong&gt;: The background Messenger worker that un-serializes the &lt;code&gt;AuditLogMessage&lt;/code&gt;, verifies its HMAC signature, and flushes it to the database takes roughly &lt;strong&gt;~1.45ms per message&lt;/strong&gt;. That equals a staggering &lt;strong&gt;~690 messages processed per second&lt;/strong&gt; per single worker thread. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Main Request Impact&lt;/strong&gt;: In pure CPU time loops, serializing a message into the queue takes about &lt;code&gt;~12.2ms&lt;/code&gt; synchronously. While this sounds comparable to a pure in-memory SQLite flush (&lt;code&gt;~10.2ms&lt;/code&gt;), the magic happens in a real networked environment. In production, a MySQL &lt;code&gt;INSERT&lt;/code&gt; over the network introduces significant IO wait times. By pushing to Redis or RabbitMQ instead, your main user request bypasses database IO completely.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bulk Processing&lt;/strong&gt;: At scale, the overhead of the bundle drops to just &lt;strong&gt;~3ms per entity&lt;/strong&gt;, making it perfect for highly intensive import scripts.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Audit logging shouldn't be a bottleneck for your application's growth. By switching to an asynchronous architecture using Symfony Messenger and the &lt;strong&gt;AuditTrailBundle&lt;/strong&gt;, you decouple your core business logic from compliance requirements, leading to virtually zero perceived overhead for your users.&lt;/p&gt;

&lt;p&gt;Ready to supercharge your Symfony audit logs? Check out the &lt;strong&gt;&lt;a href="https://github.com/rcsofttech85/AuditTrailBundle" rel="noopener noreferrer"&gt;AuditTrailBundle on GitHub&lt;/a&gt;&lt;/strong&gt;, give it a star, and drop any questions in the discussions!&lt;/p&gt;

</description>
      <category>symfony</category>
      <category>php</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>rahul chavan</dc:creator>
      <pubDate>Fri, 13 Feb 2026 16:01:57 +0000</pubDate>
      <link>https://dev.to/rahul_chavan_fa70c3ea3f79/-48b3</link>
      <guid>https://dev.to/rahul_chavan_fa70c3ea3f79/-48b3</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/rahul_chavan_fa70c3ea3f79" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3709153%2Fbbf81f63-1ad7-45c7-bdc5-8efb4e2ec559.png" alt="rahul_chavan_fa70c3ea3f79"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/rahul_chavan_fa70c3ea3f79/why-i-built-another-audit-bundle-for-symfony-1i94" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Why I Built a New Audit Bundle for Symfony (And Why Your Project Needs It)&lt;/h2&gt;
      &lt;h3&gt;rahul chavan ・ Jan 13&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#symfony&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#php&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#doctrine&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>symfony</category>
      <category>php</category>
      <category>doctrine</category>
      <category>security</category>
    </item>
    <item>
      <title>AuditTrailBundle now has a Symfony Flex recipe</title>
      <dc:creator>rahul chavan</dc:creator>
      <pubDate>Tue, 03 Feb 2026 07:53:37 +0000</pubDate>
      <link>https://dev.to/rahul_chavan_fa70c3ea3f79/audittrailbundle-now-has-a-symfony-flex-recipe-2172</link>
      <guid>https://dev.to/rahul_chavan_fa70c3ea3f79/audittrailbundle-now-has-a-symfony-flex-recipe-2172</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/rcsofttech85/AuditTrailBundle" rel="noopener noreferrer"&gt;AuditTrailBundle&lt;/a&gt; recipe has been merged into symfony/recipes-contrib&lt;/p&gt;

&lt;p&gt;This adds automatic bundle enabling and default configuration when installing the bundle.Thanks to the Symfony team and maintainers for reviewing and accepting it.&lt;/p&gt;

</description>
      <category>symfony</category>
      <category>php</category>
      <category>doctrine</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>rahul chavan</dc:creator>
      <pubDate>Thu, 29 Jan 2026 17:42:15 +0000</pubDate>
      <link>https://dev.to/rahul_chavan_fa70c3ea3f79/-9m6</link>
      <guid>https://dev.to/rahul_chavan_fa70c3ea3f79/-9m6</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/rahul_chavan_fa70c3ea3f79" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3709153%2Fbbf81f63-1ad7-45c7-bdc5-8efb4e2ec559.png" alt="rahul_chavan_fa70c3ea3f79"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/rahul_chavan_fa70c3ea3f79/why-i-built-another-audit-bundle-for-symfony-1i94" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Why I Built a New Audit Bundle for Symfony (And Why Your Project Needs It)&lt;/h2&gt;
      &lt;h3&gt;rahul chavan ・ Jan 13&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#symfony&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#php&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#doctrine&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>symfony</category>
      <category>php</category>
      <category>doctrine</category>
      <category>security</category>
    </item>
    <item>
      <title>Why I Built a New Audit Bundle for Symfony (And Why Your Project Needs It)</title>
      <dc:creator>rahul chavan</dc:creator>
      <pubDate>Tue, 13 Jan 2026 13:54:41 +0000</pubDate>
      <link>https://dev.to/rahul_chavan_fa70c3ea3f79/why-i-built-another-audit-bundle-for-symfony-1i94</link>
      <guid>https://dev.to/rahul_chavan_fa70c3ea3f79/why-i-built-another-audit-bundle-for-symfony-1i94</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
The EasyAdmin integration has been improved with a cleaner and more polished UI.  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdpr5e5idu2tyq6lcfbg0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdpr5e5idu2tyq6lcfbg0.png" alt="Easy Admin Integration" width="800" height="853"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;👉 Read the follow-up post for details.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When I started my latest Symfony enterprise project, I did what most of us do: I looked for a battle-tested &lt;strong&gt;Doctrine auditing&lt;/strong&gt; solution. But I quickly realized that existing options often felt like a trade-off. Some were too heavy, others were a nightmare to customize, and almost none addressed the critical 2026 need: &lt;strong&gt;Data Integrity.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I spent way too much time fighting performance lags and database bloat. That frustration led me to build a solution that is both lightweight and enterprise-ready.&lt;/p&gt;

&lt;p&gt;That’s why I built &lt;strong&gt;&lt;a href="https://github.com/rcsofttech85/AuditTrailBundle" rel="noopener noreferrer"&gt;AuditTrailBundle&lt;/a&gt;&lt;/strong&gt;. It’s a modern alternative for &lt;strong&gt;Symfony entity tracking&lt;/strong&gt; that focuses on performance and compliance.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Stop Logging "Noise" (Conditional Auditing)
&lt;/h3&gt;

&lt;p&gt;In high-traffic apps, logging every tiny change is a mistake. Do you really need to log a &lt;code&gt;last_login&lt;/code&gt; timestamp every 5 minutes? It wastes storage and clutters your &lt;strong&gt;audit log&lt;/strong&gt; history. &lt;/p&gt;

&lt;p&gt;I integrated &lt;strong&gt;Symfony Expression Language&lt;/strong&gt; directly into the bundle. Now, you can set "Smart Rules" to only trigger an audit if a specific condition is met. It’s &lt;strong&gt;conditional logging&lt;/strong&gt; that keeps your database clean and searchable.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The "Anti-Tamper" Proof (Audit Compliance)
&lt;/h3&gt;

&lt;p&gt;If your app needs to be &lt;strong&gt;GDPR or SOC2 compliant&lt;/strong&gt;, simply having logs isn't enough. You need to prove those logs haven't been modified. &lt;/p&gt;

&lt;p&gt;I added a &lt;strong&gt;Data Integrity Check&lt;/strong&gt; feature—a digital seal for your history. If a DBA or an attacker manually edits a log entry to hide their tracks, the bundle flags the discrepancy. It’s a built-in safety net for your &lt;strong&gt;audit trail&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Performance That Won't Slow You Down
&lt;/h3&gt;

&lt;p&gt;A common complaint with &lt;strong&gt;Symfony audit bundles&lt;/strong&gt; is the "request lag." This bundle hooks into the &lt;strong&gt;Doctrine &lt;code&gt;onFlush&lt;/code&gt; event&lt;/strong&gt;, ensuring the audit is part of the same atomic transaction. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No Orphaned Logs:&lt;/strong&gt; If your data rolls back, the audit rolls back. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Split Transport Support:&lt;/strong&gt; To keep your primary database fast, you can route audit logs to a different database connection or an external service. This is essential for &lt;strong&gt;scaling Symfony applications&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Tracking Changes (Collection Diffs)
&lt;/h3&gt;

&lt;p&gt;Most bundles fail when it comes to &lt;strong&gt;Many-to-Many relationships&lt;/strong&gt;. They might tell you a collection "changed," but not &lt;em&gt;what&lt;/em&gt; moved. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AuditTrailBundle&lt;/strong&gt; performs a deep &lt;strong&gt;Collection Diff&lt;/strong&gt;. It identifies exactly which IDs were added or removed from a relation, giving you a crystal-clear picture of your entity's history without the guesswork.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Quick Start&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Install it via Composer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require rcsofttech/audit-trail-bundle
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Summary: A Modern Tool for Modern Devs&lt;/p&gt;

&lt;p&gt;I built this to offer a performance-first architecture for developers who need precision. Whether you’re worried about database scalability or strict security compliance, this bundle handles it without the overhead.&lt;/p&gt;

&lt;p&gt;Check it out on GitHub: &lt;br&gt;
&lt;a href="https://github.com/rcsofttech85/AuditTrailBundle" rel="noopener noreferrer"&gt;Audit Bundle&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’m actively looking for feedback! If you find it helpful, please consider dropping a Star ⭐ on GitHub! It helps the project reach more developers in the Symfony community.&lt;/p&gt;

</description>
      <category>symfony</category>
      <category>php</category>
      <category>doctrine</category>
      <category>security</category>
    </item>
  </channel>
</rss>
