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||PHP requirements||Symfony requirements||Badges|
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
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
Copyright 2018 Damien Harper
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- Audit operations were stored in reverse order in transaction
- Add operation type constants
- check if is initialized before call initializeObject (#193)
- Code cleanup
- Headers adjustments
- Added build badges for supported branches
- Refactoring (#188)
- Don't specify the doctrine connection in services.yml (#185)
- Fixed audit annotation loader
- Fixed broken path to helper
- Fixed broken annotated route loader
- Include 3.x branch on Travis
- Simplified class names (#182)
- AuditHelper Refactoring (#181)
- Update requirements (#180)
- 3.4.0 release
- Add missing discriminator property and getter to AuditEntry
- Fix PHPStan rules
- Leverage `DoctrineHelper::getRealClassName()` to avoid proxy references in audit entries (#179)
- Removal of a doc leftover since PagerFanta removal (#173)
- Changed how the entity FQDN is obtained (#175)
- Fix #169
- Add audited entity FQCN to event payload (#174)
- Adding date range function getAuditsByDate (#172)
- Cleanup command accepts an ISO 8601 date interval (#170)
- Fixed PHP 7.1 BC break
- Updated CHANGELOG.md
- Fixed a BC break with symfony 4.3+
- Updated CHANGELOG.md
- Ordered `require` and `require-dev` sections of composer.json