Welcome Guest, Not a member yet? Register   Sign In
Audit Logging or an Audit Trail
#1

[eluser]tisoysasugbo[/eluser]
Hi All,

Does anybody knows about audit logging or audit trail in CI?Any plugin that's already available?

I need to be able to log all changes from INSERT/UPDATE/DELETE on every table.
This must include table name, field old value, field new value and user.

Appreciate if anybody can give me an idea.

Thanks,
#2

[eluser]WanWizard[/eluser]
I have solved that by extending the database class (requires a core hack) and overloading the insert, update, delete and where (i need the selection criteria) methods.

If you want to have the old value too, you need to come up with an solution to read and compare, which might be difficult if an update or delete affects multiple rows.
#3

[eluser]tisoysasugbo[/eluser]
Thanks for the response Smile

Oh... do I have to this from scratch? Sad
Any plugin that I can use?
#4

[eluser]WanWizard[/eluser]
I can't give you full code at the moment, development of the exitecms workflow engine is done in a non-public branch.
But you can check the code in the main trunk to see how you have to modify the database library to allow the DB_Active_rec.php to be extended. Click on the link below and go to "browse source".
#5

[eluser]tisoysasugbo[/eluser]
Thanks, I will go thru this first and study it.




Theme © iAndrew 2016 - Forum software by © MyBB