PHPBuilder - File based, custom logging Page 5

RSS Twitter

File based, custom logging - Page 5

by: John Starkey
September 30, 2002

Added Advantages

I particularly like logging my errors to files because you can always open a shell on Linux/Unix and do 'tail -f /tmp/article.log' to view any errors in real time. Even if the site is not in a production state it can still be of great benefit, provided your error handling is detailed enough to lead you to the cause.
Another great advantage of logging to a file: if you have access to the config file for the Linux/Unix binary 'logrotate', you can rotate these files automatically. This will prevent them from growing too big and will provide an archive over several weeks or months.
As stated, this is intended for the beginner programmer and is only one of a whole plethora of ways to log your errors. The above example will log only the errors you send to it, which is obviously not the most optimal way to handle your errors. In the next article, I will delve into errors that come directly from the PHP parser.
I hope this helps! Til next time....

« Previous Page

Comment and Contribute

Your comment has been submitted and is pending approval.

John Starkey



(Maximum characters: 1200). You have characters left.