Advanced logging system


In my system I have lots of tables, like companies/users etc and I need to log all events which I want to be logged. For example, if i add a new user I want to log this event, and afterwards I need to have a history. And of course I want to be able to filter that history, for example by events, and maybe... other typical functions.

I think that the most simple way is to create a table and just write all the information there. But maybe it's not the best solution or maybe there is a library for such things.

Btw I dont want to use standart codeigniter logger, because of the levels-system, because it writes to file (hard to get 1000 records and sort them by event or date)

And also, there is a specific task: to log all logins/logouts, so that a user can watch when he entered the site and what time it was and what ip address he had.

So I'm thinking about 2 tables, first "user_sessions", second is just "events", and just write to them. Is it a good way?

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.