Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Recording the Breaks:
Logging Errors in PHP
Oct 01, 2002 @ 12:43:46

Well, they're not as few and far between as they once were, but it's still not the PHPBuilder.com we all used to know. They've redeemed themselves a bit by posting some of the articles that they have left, but it makes you wonder when they're going to run out.

Anyway, since this is about their newest article, File based, custom logging, I'll get on with it. This latest posting talks about throwing the errors that your PHP application gets back to a log file, rather than out to the screen where everyone can see it. Using PHP's own functions (like error_log and set_error_handler), you can create a simple logging system that will take all server-side error messages and toss them into a text file for you to review whenever you'd like.

I've noticed that there's quite a few people out there that hack together PHP scripts without thinking about things like error logging, or how the browser will react if something goes wrong with their script. They just assume that there's nothing that they can see wrong with it, so it must be just fine (unfortunately).

tagged:

Link:


Trending Topics: