News Feed
Sections




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

NetTuts.com:
Quick Tip Email Error Logs with PHP
January 04, 2011 @ 08:58:45

In this quick tip from NetTuts.com today they show you how to set up custom error logging for your PHP application with the help of the set_error_handler function.

In today's video quick tip, we'll review the process of setting custom error handlers with PHP. Along the way, we'll also learn how to log and email those potential errors to ourselves. That way, even when your web application has been deployed, you'll be the first to know when an error is encountered.

They make a custom handler, nettuts_error_handler, that takes in the error information and translates it into an error message that's emailed to an admin of the site. It also checks the error reporting level to see if it needs to display the error back to the user or not. This helpful hint is part of a screencast, but they've provided the code separately to make it easier to work with.

2 comments voice your opinion now!
error log email custom seterrorhandler


blog comments powered by Disqus

Similar Posts

Gonzalo Ayuso: Playing with event dispatcher and Silex. Sending logs to a remote server.

Evert Pot's Blog: Internationalized domain names, are you ready?

SitePoint PHP Blog: How to Make WordPress Easier for Clients, Part 1: Custom Branding

Dave Marshall's Blog: Log memory usage using declare and ticks in PHP

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 7)


Community Events





Don't see your event here?
Let us know!


interview api install podcast refactor language opinion list testing code developer threedevsandamaybe series introduction laravel release community unittest symfony2 framework

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework