Welcome Guest, Not a member yet? Register   Sign In
Audit Trial

Hi All,

Does anybody knows about audit logging or audit trail in CI? Any plugin that's already available? I wonder why no plugin available in detail.

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.


(This post was last modified: 11-27-2017, 09:31 AM by PaulD. Edit Reason: Added links )

Well I know of two ways. One is to have a history table that has something like affected id, old value, new value, date changed, table affected, userid etc etc. Whenever you do a table function, you write a history record for it. I have done this but rolling back is a pain, and the table gets very big very quickly.

The other I have only read about is that MySQL offers features where whenever a table operation happens, a record is written to keep track of it. This is done on the database itself so it cannot be bypassed and is independent of the script interacting with the database.

I will google for it and see if I can find it again and will post it here if I can find it.


PS I imagine that no scripts are available because it is such an app dependent thing that no script would work from one site to another. ie pretty difficult to generalise.

Again, I have no experience of doing this but it looked interesting, so these links might not be overly useful. Cannot find the article I read about this which was a shame.

Found another thing on github

Theme © iAndrew 2016 - Forum software by © MyBB