PHPackages                             polysource/audit - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. polysource/audit

ActiveSymfony-bundle[Logging &amp; Monitoring](/categories/logging)

polysource/audit
================

Polysource — audit log for non-Doctrine actions: AuditEntry VO, fan-out logger interface, browsable AuditLogResource, GDPR Art. 30 CSV export, retention command.

v0.9.0(2mo ago)011MITPHP &gt;=8.1

Since May 10Compare

[ Source](https://github.com/polysource/audit)[ Packagist](https://packagist.org/packages/polysource/audit)[ Docs](https://github.com/polysource/polysource)[ RSS](/packages/polysource-audit/feed)WikiDiscussions Synced 3w ago

READMEChangelogDependencies (14)Versions (26)Used By (0)

polysource/audit
================

[](#polysourceaudit)

> GDPR Art. 30 / HIPAA audit trail for Polysource admin actions.

Part of the [Polysource](https://github.com/polysource/polysource) monorepo. MIT-licensed.

When to use
-----------

[](#when-to-use)

You're running a regulated workload (healthcare, finance, B2B SaaS) and need a write-only, queryable log of every admin action: who did what, when, from where, with what outcome.

What it ships
-------------

[](#what-it-ships)

- **`AuditEntry`** VO + **`AuditOutcome`** enum + **`AuditActorInterface`** (`SymfonySecurityAuditActor` default impl).
- **`AuditLoggerInterface`** (write-only) with fan-out via `AggregateAuditLogger`.
- **`DoctrineAuditLogger`** + Doctrine entity (`polysource_audit_log` table with 3 indexes for Art. 30 queries).
- **`ActionAuditSubscriber`** — bridges `ActionAboutToExecuteEvent` / `ActionExecutedEvent` (dispatched by `polysource/symfony-bundle`) to the logger. UUID v7 per entry, IP/UA/RequestID in context, trace truncated to 8KB.
- **`EasyAdminAuditSubscriber`** — optional bridge that audits EA CRUD edits (Edit / New / Delete on Doctrine entities). Auto-wired when `easycorp/easyadmin-bundle` is installed (gated on `class_exists`); inert otherwise.
- **`AuditLogResource`** — browsable admin resource with 5 standard filters (time range, actor, outcome, action name, resource).
- **`ExportAuditCsvAction`** — GDPR Art. 30 export with 12 locked columns (RFC 4180), gated on `POLYSOURCE_AUDIT_EXPORT`.
- **`polysource:audit:purge --before`** — retention command with cutoff exclusive, `--dry-run`, exit codes.

See [ADR-020](../../docs/adr/0020-audit-non-doctrine-actions.md).

Install
-------

[](#install)

```
composer require polysource/audit
```

`polysource/audit` declares **`doctrine/orm` and `doctrine/dbal` as hard runtime dependencies**. The bundled persistence layer (`DoctrineAuditLogger`, `AuditEntryRecord`, `AuditLogDataSource`, `PurgeAuditCommand`, `ExportAuditCsvAction`) imports Doctrine at compile time, so installing this package without Doctrine would fatal at autoload. If your host already runs Doctrine for any other reason — most Symfony apps do — the cost is zero. If you need the contracts without Doctrine, depend on `polysource/core` directly and ship a custom `AuditLoggerInterface` implementation; only the storage layer is Doctrine-coupled.

Register the bundle:

```
return [
    Polysource\Audit\PolysourceAuditBundle::class => ['all' => true],
];
```

Run the migration to create `polysource_audit_log`.

Extend it
---------

[](#extend-it)

`AuditLoggerInterface` is **1 method** (`log(AuditEntry $entry)`). To pipe events to Splunk, Datadog, OpenSearch, or any SIEM:

```
#[AutoconfigureTag('polysource.audit_logger')]
final class SplunkAuditLogger implements AuditLoggerInterface
{
    public function log(AuditEntry $entry): void
    {
        $this->splunk->send([
            'time' => $entry->occurredAt->format(\DateTimeInterface::ATOM),
            'event' => $entry->actionName,
            'actor' => $entry->actorId,
            'outcome' => $entry->outcome->value,
        ]);
    }
}
```

The `AggregateAuditLogger` fan-outs across every tagged logger with try/catch isolation — Splunk timing out doesn't break the Doctrine write. See [extensibility map](../../docs/user/extensibility.md#4-pipe-audit-log-to-your-siem).

Documentation
-------------

[](#documentation)

- [Audit walkthrough](../../docs/user/audit/)

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance86

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

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 ~0 days

Total

25

Last Release

68d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/41d53ab82016651b0a4a9ef71644a54f934d8bf54ccbc59fc0183f994213ef38?d=identicon)[samaym](/maintainers/samaym)

---

Tags

symfonyAuditgdprcomplianceaudit-logpolysource

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M400](/packages/easycorp-easyadmin-bundle)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M754](/packages/sylius-sylius)[sulu/sulu

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

1.3k1.4M215](/packages/sulu-sulu)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k64](/packages/open-dxp-opendxp)[contao/core-bundle

Contao Open Source CMS

1231.6M2.8k](/packages/contao-core-bundle)

PHPackages © 2026

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