How can I catch all application exceptions and PHP errors in production environment?
I am using a custom MVC framework, and I have a entry point where my MVC framework starts. So I already wrap this entry point with a general:
try{
//start point of mvc framework that load main class
//that manage request, response, route etc
}catch(Exception $e) {
//return response 404 to client if something goes wrong
}
Is this enough? What about PHP errors?
It's a production environment so I don't the users to see the errors, but I want to log all for debugging. Is there an opensource PHP class that log errors in a elegant way that I can inspire from?