What is the best practice for logging users activity?
===

I'm to implement users activity logging for my web app (`php`+`js`+`mysql`).

Previousely, i've used this appoach: 

 - on users login create a temporary table in the database to store users id
 - create triggers for all tables which insert row in `activity` table using users id from that temporary table

Now i don't really want to put so much logic in the database, so my qiestion is: what is the best practice? Should i stay whith the described method, or should i use some (what?) another?

**edit**
I've seen [this](http://stackoverflow.com/questions/2488267/how-to-log-user-actions-with-php-and-mysql) question, but i'm intrested in comparing described method with one in the answers.