0

I try to use apache2gelf to send my error.log information to a graylog2 server.

To use that tool I have to change the ErrorLog setting to:

ErrorLog "|| /path/to/errorlog2gelf.py --vhost example.com"

errorlog2gelf.py itself is besides sending the input to the graylog2 server also outputting the error message again so it's possible to store it additionally into a local file.

Unfortunately I don't know how to accomplish this. I already tried piping into a file with following setting:

ErrorLog "|| /path/to/errorlog2gelf.py --vhost example.com >/var/log/httpd/error_log"

But that just throws an error from errorlog2gelf, as that program tries to interpret that as an argument, which is obviously an invalid option.

So how can I use errorlog2gelf and in parallel write to a local error.log file?

1 Answer 1

1

I only see 2 solutions for this:

  1. Make that script to write directly to a file.

  2. Log to syslog and pipe the log from syslog to errorlog2gelf (and send only the raw message to it). Syslog is much more flexible and will allow you to also write to a file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .