http://pear.php.net/package/Log
I'd check out the logging pear class. You can select what type of log you want (file, sql, syslog, sqlite, mail, etc.) so if you ever need to change the format down the road it'll be much easier.
I haven't used this class yet, but from looking at the API in the past, it seemed very easy to integrate into any application.
-r