PHPackages                             pbweb/audit-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. pbweb/audit-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

pbweb/audit-bundle
==================

PB Web Media Audit Bundle for Symfony

3.3.1(4mo ago)16.7kMITPHPPHP &gt;=8.1

Since Dec 22Pushed 4mo ago3 watchersCompare

[ Source](https://github.com/PBWebMedia/audit-bundle)[ Packagist](https://packagist.org/packages/pbweb/audit-bundle)[ RSS](/packages/pbweb-audit-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (12)Versions (18)Used By (0)

PB Web Media Audit Bundle
=========================

[](#pb-web-media-audit-bundle)

Provides an easily extendible Symfony Bundle to create an audit log.

Installation
------------

[](#installation)

Install the audit-bundle using composer:

```
composer require pbweb/audit-bundle

```

Usage
-----

[](#usage)

To insert an entry in the audit logger, create an `AuditEvent` and give it to the `AuditLog`

```
$event = new \Pbweb\AuditBundle\Event\AuditEvent('test');
$log = $container->get('pbweb_audit.audit_log');
$log->log($event);
```

You can also create your own events (which we recommend), as long as they implement the `AuditEventInterface`.

### Flow

[](#flow)

Events enter the audit logger which will then trigger the following events (in order) with the provided `AuditEventInterface` event as an argument:

1. `Pbweb\AuditBundle\Event\AppendAuditEvent`
2. The class name of `$event`
3. `Pbweb\AuditBundle\Event\LogAuditEvent`

That way you can hook into generic flow moments or only respond to specific events.

The Audit Bundle uses the Symfony event system so all the normal shenanigans (like listener priorities, stopping propagation, etc) work when handling these events.

Event appenders
---------------

[](#event-appenders)

Events aren't usually complete by themselves, you probably want to append some data related to the event like the user that triggered it or the ip of the client.

To do this listen to the `Pbweb\AuditBundle\Event\AppendAuditEvent` event (either through a [listener](http://symfony.com/doc/current/event_dispatcher.html#creating-an-event-listener)or [subscriber](http://symfony.com/doc/current/event_dispatcher.html#creating-an-event-subscriber)). It will receive all `AuditEventInterface` events that go into the audit log.

### Default event appenders

[](#default-event-appenders)

The Audit Bundle comes packaged with a few event appenders that will be loaded by default, see the configuration section below on how to disable that.

If you use these appenders, you need to add `symfony/security` to your project.

Loggers
-------

[](#loggers)

Eventually the audit log entries need to go somewhere, either the database, a PSR logger or whatever you can think of.

The Audit Bundle comes packaged with a PSR logger and Doctrine logger (see below).

You can also implement your own logger by listening to the `Pbweb\AuditBundle\Event\LogAuditEvent` event. It will receive all `AuditEventInterface` events that go into the audit log.

### PSR logger

[](#psr-logger)

By default the Audit Bundle loads the `PsrLogger`, which will use the `@logger` service to log events to your default log. Look at the configuration section below on how to disable this behaviour.

### Doctrine logger

[](#doctrine-logger)

For small(ish) audit logs you could use the database as a data store. The Audit Bundle comes with an `AbstractDoctrineLogger`. The only thing you need to do is create a service that implements the `convertToEntity` method and give it the tag `kernel.event_subscriber`.

Configuration
-------------

[](#configuration)

You can optionally configure the audit bundle in your `app/config.yml` file

```
pbweb_audit:
    load_default_event_loggers: true    # loads the loggers defined in Pbweb/AuditBundle/Resources/config/default/loggers.yml
    load_default_event_appenders: true  # loads the event appenders in Pbweb/AuditBundle/Resources/config/default/appenders.yml
```

Copyright
---------

[](#copyright)

© PB Web Media

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance75

Regular maintenance activity

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~205 days

Recently: every ~163 days

Total

17

Last Release

138d ago

Major Versions

1.2.4 → 2.02021-09-24

2.1 → 3.02022-08-12

PHP version history (5 changes)1.0PHP ^7.0

1.2PHP ^7.1

1.2.4PHP &gt;=7.1

2.0PHP &gt;=8.0

3.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/c0df11fc03f908635c3a99109be3d1110741e59c1ee71bb4723c006ae4b751a1?d=identicon)[DemonTPx](/maintainers/DemonTPx)

---

Top Contributors

[![DemonTPx](https://avatars.githubusercontent.com/u/2570835?v=4)](https://github.com/DemonTPx "DemonTPx (39 commits)")

---

Tags

symfonybundleAudit

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pbweb-audit-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/pbweb-audit-bundle/health.svg)](https://phpackages.com/packages/pbweb-audit-bundle)
```

###  Alternatives

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[pentatrion/vite-bundle

Vite integration for your Symfony app

2725.3M13](/packages/pentatrion-vite-bundle)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[pugx/autocompleter-bundle

Add an autocomplete type to forms

93861.6k3](/packages/pugx-autocompleter-bundle)[sensiolabs/gotenberg-bundle

A Symfony bundle that provides seamless integration with Gotenberg for generating PDFs and screenshots from various sources (HTML, Markdown, Office documents, URLs) with a clean, builder-based API.

210210.4k2](/packages/sensiolabs-gotenberg-bundle)[sineflow/clamav

ClamAV PHP Client for Symfony

10168.5k](/packages/sineflow-clamav)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
