Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you log php errors to multiple files?

Is it possible to send the same error to a global php error log in /var/log/php_errors as well as send the same error to a local error log in /var/www/mysite/php_errors?

On our staging server, I tail the log file, and a lot of wordpress stuff as well as some big ugly print_r's will come through from other developers. I'd like to have a global error file to see if there is anything breaking server wide from time to time, as well as separate out my local errors so I can follow them better if I'm only interested in one site at the moment.

like image 645
yellottyellott Avatar asked Mar 19 '12 21:03

yellottyellott


1 Answers

Use set_error_handler and make a custom error function with as much logging as you like.

like image 58
Ingmar Boddington Avatar answered Sep 18 '22 22:09

Ingmar Boddington