I have a legacy app that runs under PHP and Apache.
It does all its logging via error_log(), which ends up in Apache's error.log.
I'd like to only send error messages to error.log, and send other logging to access.log.
What are my options? I would rather not drastically overhaul the Apache's logs format, because other tools parse it.
- I see a solution using
apache_note. - I can imagine that making both Apache and PHP write to syslog, and configuring syslog to filter the messages by source and severity would allow me to have neat
access.loganderror.logwith two or more writers.
Am I missing a simpler solution?
access.logis not for application logging. Use a PSR-3 logger like Monolog for application logging.