I am developing PHP websites on my own and want to turn off displaying error messages to the browser as sites move into production. I thought about setting up Monolog but am worried that with just me developing it might be overkill and more maintenance.
I can see that errors are being recorded in /var/log/apache2/error.log
and that I can use error_log(json_encode($someArray)
to do debugging.
Is this approach realistic or will it be a total pain? If it is feasible are there ways of making the output from $ tail -f error.log
prettier eg formatting arrays and having an empty line between each log entry? I have read about the ErrorLogFormat Directive
on the Apache website but currently do not understand it very much.