1

I would like to have all the output from the (perl) CGIs in its own log file.

What i tried:

Setting ScriptLog /var/log/httpd/cgi.log in httpd.conf, but this had no effect. Probably something else is missing.

Any ideas?

arved
  • 453
  • 2
  • 14
  • Your understanding of what ScriptLog does and the [official documentation on ScriptLog](http://httpd.apache.org/docs/current/mod/mod_cgi.html#scriptlog) seem to be at odds. –  Jul 29 '16 at 22:36
  • `The ScriptLog directive sets the CGI script error logfile`: This sounds exactly what i want to do. Just that nothing is happening. – arved Aug 01 '16 at 11:05

1 Answers1

1

ScriptLog only logs errors. You can use comparison values at the end of the CustomLog statement to output specific events into another log. I think something like this will do what you want (tested):

    SetEnvIf Request_URI "^/cgi-bin/" cgilog
    CustomLog ${APACHE_LOG_DIR}/access.log combined env=!cgilog
    CustomLog ${APACHE_LOG_DIR}/cgi.log combined env=cgilog
David
  • 606
  • 4
  • 6
  • This does the acesslog part of the CGIs into its own file. It would be nice to have the error.log there too – arved Aug 01 '16 at 11:07
  • True, but I don't think there is a way to do that for general errors. Errors from the CGI stderr output will go to the ScriptLog file so you could combine those. – David Aug 01 '16 at 16:07