Reputation: 40894
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.
apache_note
.access.log
and error.log
with two or more writers.Am I missing a simpler solution?
Upvotes: 0
Views: 1367
Reputation: 53563
access.log
is intended to record web server connection activity, and should not be used for application logging. See PSR-3
for a definition of a logger interface. This is implemented by popular packages like Monolog.
Upvotes: 1