{"id":20674680,"url":"https://github.com/pbwebmedia/audit-bundle","last_synced_at":"2026-05-08T03:04:47.173Z","repository":{"id":50098781,"uuid":"77069404","full_name":"PBWebMedia/audit-bundle","owner":"PBWebMedia","description":"Easily extendible Symfony Bundle to create an audit log","archived":false,"fork":false,"pushed_at":"2024-04-10T14:11:46.000Z","size":452,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-18T17:54:15.422Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PBWebMedia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-21T16:46:07.000Z","updated_at":"2022-04-01T10:11:02.000Z","dependencies_parsed_at":"2024-03-08T14:49:45.890Z","dependency_job_id":"efd37e0e-d3af-46c1-9a55-1b02badf0080","html_url":"https://github.com/PBWebMedia/audit-bundle","commit_stats":{"total_commits":59,"total_committers":6,"mean_commits":9.833333333333334,"dds":0.5593220338983051,"last_synced_commit":"549d01d339c67e87dd1670694509922d064d0cc3"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PBWebMedia%2Faudit-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PBWebMedia%2Faudit-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PBWebMedia%2Faudit-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PBWebMedia%2Faudit-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PBWebMedia","download_url":"https://codeload.github.com/PBWebMedia/audit-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242901572,"owners_count":20203967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T21:06:40.902Z","updated_at":"2025-12-25T03:12:24.786Z","avatar_url":"https://github.com/PBWebMedia.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PB Web Media Audit Bundle\n\nProvides an easily extendible Symfony Bundle to create an audit log.\n\n## Installation\nInstall the audit-bundle using composer:\n\n```\ncomposer require pbweb/audit-bundle\n```\n\n## Usage\nTo insert an entry in the audit logger, create an `AuditEvent` and give it to the `AuditLog`\n\n```php\n$event = new \\Pbweb\\AuditBundle\\Event\\AuditEvent('test');\n$log = $container-\u003eget('pbweb_audit.audit_log');\n$log-\u003elog($event);\n```\n\nYou can also create your own events (which we recommend), as long as they implement the `AuditEventInterface`.\n\n### Flow\nEvents enter the audit logger which will then trigger the following events (in order) with the provided `AuditEventInterface` event as an argument:\n1. `Pbweb\\AuditBundle\\Event\\AppendAuditEvent`\n1. The class name of `$event`\n1. `Pbweb\\AuditBundle\\Event\\LogAuditEvent`\n\nThat way you can hook into generic flow moments or only respond to specific events.\n\nThe Audit Bundle uses the Symfony event system so all the normal shenanigans (like listener priorities, stopping propagation, etc) work when handling these events.\n\n## Event appenders\nEvents 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.\n\nTo 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)\nor [subscriber](http://symfony.com/doc/current/event_dispatcher.html#creating-an-event-subscriber)).\nIt will receive all `AuditEventInterface` events that go into the audit log.\n\n### Default event appenders\nThe 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.\n\nIf you use these appenders, you need to add `symfony/security` to your project.\n\n## Loggers\nEventually the audit log entries need to go somewhere, either the database, a PSR logger or whatever you can think of.\n\nThe Audit Bundle comes packaged with a PSR logger and Doctrine logger (see below).\n\nYou can also implement your own logger by listening to the `Pbweb\\AuditBundle\\Event\\LogAuditEvent` event.\nIt will receive all `AuditEventInterface` events that go into the audit log.\n\n### PSR logger\nBy default the Audit Bundle loads the `PsrLogger`, which will use the `@logger` service to log events to your default log.\nLook at the configuration section below on how to disable this behaviour.\n\n### Doctrine logger\nFor small(ish) audit logs you could use the database as a data store.\nThe Audit Bundle comes with an `AbstractDoctrineLogger`.\nThe only thing you need to do is create a service that implements the `convertToEntity` method and give it the tag `kernel.event_subscriber`.\n\n## Configuration\nYou can optionally configure the audit bundle in your `app/config.yml` file\n\n```yaml\npbweb_audit:\n    load_default_event_loggers: true    # loads the loggers defined in Pbweb/AuditBundle/Resources/config/default/loggers.yml\n    load_default_event_appenders: true  # loads the event appenders in Pbweb/AuditBundle/Resources/config/default/appenders.yml\n```\n\n## Copyright\n© PB Web Media\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpbwebmedia%2Faudit-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpbwebmedia%2Faudit-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpbwebmedia%2Faudit-bundle/lists"}