basketmen — 2012-03-26T20:20:01-04:00 — #1
Each time our site got error messages, is stored in a home/username/public_html/error_log file, in ftp right?
i wonder can i get notification to email each time new error message added/increased? the response or notification is the most important, so can fixing the problem asap, and since some of us not to often accessing+checking the ftp
dklynn — 2012-03-26T22:57:44-04:00 — #2
Good thought ... but the log is a special entity.
I've made a quick check at Apache.org and they don't appear to have a mechanism for e-mailing error reports. That then falls upon the webmaster to use a custom error handler to write to the logs as well as e-mailing you. Don't worry, SitePoint's PHP Anthology book has a section on custom error handlers.
timigoe — 2012-03-27T04:07:46-04:00 — #3
You will need to investigate a log processing / log handling system - maybe even a simple script you write yourself that tail's the file and emails out any changes from it.
Depending on the type of error in the log, you could potentially catch them in your code and email from within the sites code?
dklynn — 2012-03-27T17:37:58-04:00 — #4
On second thought, the PHP error handler will only help PHP errors (which should have been thoroughly tested before putting online). What type of errors are you looking to be notified about? Apache errors? PHP errors? MySQL errors? I think that a cron script looking at the length of your error log (for changes) may be more realistic for you.