This bundle 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 there is an user in token storage, it is used to identify the user who made the changes.
- audit entries are inserted within the same transaction during flush event so that even if something fails the global state remains clean.
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 doctrine-audit-bundle-demo.
The official documentation can be found here.
Version | Status | Required PHP Version |
---|---|---|
3.x | Active support 🚀 | >= 7.1 |
2.x | Active support | >= 7.1 |
1.x | End of life | >= 7.1 |
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.
DoctrineAuditBundle 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
- MySQL
- MariaDB
- PostgreSQL
- SQLite
This bundle should work with any other database supported by Doctrine. Though, we can only really support the ones we can test with Travis CI.
- Thanks to all contributors
- This bundle initially took some inspiration from data-dog/audit-bundle and simplethings/entity-audit-bundle
DoctrineAuditBundle is free to use and is licensed under the MIT license