0

I have a requirement where httpd needs to write logs to an external program . If specified, nothing would be logged in the httpd.log and access.log files instead would be redirected , i am aware that the same can be accomplished using piped logging .

CustomLog "|/usr/local/apache/bin/piped.pl /var/www/logs/piped_log" combined

or

CustomLog "|/bin/logger /var/syslog" combined

But piped logging has below drawbacks as listed below

1.One process is created for every piped logging instance configured in the configuration. This makes piped logging impractical for virtual hosting systems where there are hundreds, or possibly thousands, of different hosts.

2.The external programs run as the user that has started the web server, typically root. This makes the logging code a big liability.

Now is there a way where we can write or redirect logs from httpd directly to an external program and apache is not controlling the external program but simply writing to it .

also can we use log4c by integrating with apache webserver for redirecting logs

  • Todays Linux systems typically use `rsyslog` as central logging daemon. You can configure `rsyslog` to read changes in the apache log files to process new entries. That allows to offer all the flexibility `rsyslog` offers to filter, rewrite and forward log entries to whatever system, socket, process or file you want. – arkascha Nov 09 '22 at 06:41

0 Answers0