The purpose of auditor
is to provide an easy and standardized way to collect audit logs.
This library is architected around two concepts:
- Auditing services responsible for collecting audit events
- Storage services responsible for persisting audit traces Those two kind of services are offered by Providers.
A default provider is included with this library: the DoctrineProvider
DoctrineProvider
offers both auditing services and sorage services.
It creates audit logs for all Doctrine ORM
database related changes:
- inserts and updates including their diffs and relation field diffs.
- many to many relation changes, association and dissociation actions.
- if available, the user responsible for these changes and his IP address are recorded.
- audit entries are inserted within the same transaction during flush event so that even if something fails the global state remains clean.
DoctrineProvider
supports following RDBMS
- MySQL
- MariaDB
- PostgreSQL
- SQLite
DoctrineProvider
should work with any other database supported by Doctrine
.
Though, we can only really support the ones we can test with Travis CI.
Basically you can track any change of any entity from audit logs.
NOTE: this bundle cannot track DQL or direct SQL update or delete statement executions.
You can try out this bundle by cloning its companion demo app. Follow instructions at auditor-demo.
auditor
official documentation can be found here.
DoctrineProvider
official documentation can be found here.
Version | Status | PHP requirements | Symfony requirements | Badges |
---|---|---|---|---|
1.x | Active development 🚀 | >= 7.2 | >= 3.4 |
Changelog is available here
Once installed and configured, any database change affecting audited entities will be logged to audit logs automatically. Also, running schema update or similar will automatically setup audit logs for every new auditable entity.
auditor is an open source project. Contributions made by the community are welcome. Send us your ideas, code reviews, pull requests and feature requests to help us improve this project.
Do not forget to provide unit tests when contributing to this project. To do so, follow instructions in this dedicated README
- Thanks to all contributors
- This library initially took some inspiration from data-dog/audit-bundle and simplethings/entity-audit-bundle
auditor
is free to use and is licensed under the MIT license