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.
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.
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.
Ciao
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.
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….