The easiest way is to use a framework that has it built in.Otherwise the best way is to build a central db function / class and build the logging into that when using php.
The other option would be to turn on query logging in mysql and let the db do it.
_________________
Lostboy
Cat, the other other white meat
Please read
Posting Etiquette before posting
You can always try
Google