Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I like to maintain separate Apache2 logfiles for each of my named virtual hosts, like this:

<VirtualHost *:80>
  ErrorLog /var/log/apache2/myhost-error.log
</VirtualHost *:80>

The nominated file correctly gathers error-messages generated by Apache2 itself, such as 404s:

[Thu Jul 18 12:07:45 2013] [error] [client] File does not exist: /home/mike/myhost/htdocs/favicon.ico

But when myhost runs mod_perl scripts which emit their own logging messages (using print to STDERR, for example), those messages still appear in the global Apache2 error-log, /var/log/apache2/error.log.

This is using Apache 2.2.16 on Debian GNU/Linux 6.0, but I also see the same thing on Ubuntu 12.04.2 LTS and on MacOS 10.5 -- I guess it's standard Apache2 behaviour.

I want my mod_perl scripts' logging to appear in the site-specific error-log just like the 404s and other Apache-level errors. How can I make this happen?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.