How to display errors in the production environment?

1

I'm coming from the hustle of this ask here .

Is there any way in the production environment, when an error occurs I warn you, that the error occurred and that I should look at the log file?

I wanted it to appear on the screen something like this when an error occurs: Ocorreu um erro, verifique o arquivo de log do sistema .

Remembering that I come from the above question, so in case the production environment does not display errors, I just save them to a log file.

    
asked by anonymous 10.03.2016 / 03:37

1 answer

3

In PHP you can use the set_error_handler() function, and create your own type error handling function:

minha_funcao_trata_erros(){
  //sua lógica
}
set_error_handler("minha_funcao_trata_erros");

In this link you can see the documentation for the set_error_handler() link

    
10.03.2016 / 05:01