Log user actions
Posted on 2007-08-07
For a webapplication I would like to be able to see what users do exactly, using some kind of logging system. What I have in mind is something like:
Public Sub Log(ByVal UserID As Integer, ByVal Action As Integer, ByVal Parameter As Integer)
MyData.InsertLogEntry(UserID, Action, Parameter)
This then should be attached to methods reading, updating, inserting and deleting data. For example:
Public Sub Delete(ByVal MessageID As Integer)
LogSystem.Log(MyUserID, 100, MessageID) 'The number 100 is the log action defined in the database
Something like that. This is of course a rough sketch, as it has some flaws (for example what if a method has more than one parameter, should be saved as well).
Basically I would like to be able to be able to save each action done by a user. And preferably without having to extend each method.
Does anyone know how something like this could be achieved?
Martin de Ruiter