Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best Practices for Live Website Error Management

I am just about to launch a fairly large website for the first time. I have turned off all error messages in my php.ini and error messages are now logged to an "error_log" file on my server.

My question is, now that the errors are logged to a file, what are the best ways that web developers keep on top of seeing when/where errors occur on the website?

At the moment, it seems like the best way would be to constantly check the error_log file everyday, however this doesn't seem like the most efficient solution. Ideally I would receive an email everytime an error occurs (with the error message). Any advice on how I can keep on top of errors would be greatly appreciated!

Extra Info
Running on Shared Server (HostMonster)
Website Authored in PHP

like image 897
justinl Avatar asked Oct 16 '09 23:10

justinl


1 Answers

There are two main functions in PHP that help catching errors and exceptions. I suggest that you take a look at them :

  • set_exception_handler
  • set_error_handler

In our company, we handle all errors that occurs on our websites with those functions, defining our own errors and exceptions handling methods.

When an error occurs, an email is sent to the developers team.

like image 55
MaxiWheat Avatar answered Oct 04 '22 05:10

MaxiWheat