note 36729 added to function.set-error-handler

From: Date: Mon, 20 Oct 2003 14:03:02 +0000
Subject: note 36729 added to function.set-error-handler
Groups: php.notes 
Request: Send a blank email to php-notes+get-58943@lists.php.net to get a copy of this message
PHP does not really provide a way to catch all errors including parsing errors or for instance form file uploading errors. Ideally, there should be a way to catch these errors and mail a system administrator so he can take immediate action. The best you can do is to disable all output of errors to the pages and enable error logging to a file. Then you should take a look at this error log file periodically to figure what may be wrong. The problem is that you can't just wait and sit there watching for errors in the log files until they happen. To solve this problem you may want to try this class that lets you watch a given error file periodically and mail the new log lines to a given address of the site developer or system administrator. http://www.phpclasses.org/logwatcher It is like the Unix tail command except that you should run this from a cron task periodically (lets say, every 5 minutes). The class keeps track of the last log line that was read on each log file poll, so it knows where to resume checking the log file on the next time the cron task is run. ---- Manual Page -- http://www.php.net/manual/en/function.set-error-handler.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+36729 Delete -- http://master.php.net/manage/user-notes.php?action=delete+36729&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+36729&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#58943) next »