[eluser]davidbehler[/eluser]
You could write a small library and whenever the user does something that you want to log, you call a method of that library and tell it to insert a new entry into the database.
Look
here for infos on how to create your own libraries.