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 have about 10 VirtualHosts and I like to keep the error_logs separated. Recently, I need to also have the error_logs all combined for some mod_security scanning.

If I define 2 ErrorLogs for a test VirtualDomain, I notice that no error's are being logged. Pretty strange.

Is it possible to have a CustomLog play the role of an ErrorLog?

Or am I defining my 2 ErrorLogs incorrectly?

    DocumentRoot /var/www/html/mydomain
    UseCanonicalName Off

    ErrorLog logs/
    ErrorLog logs/unified_modsecurity-error_log

    CustomLog logs/ combined
    UserDir disabled
    UserDir enabled mydomainuser
share|improve this question
up vote 2 down vote accepted

No, it is not possible to have two ErrorLog directives per VirtualHost. However, you could use Apache's ability to pipe to a command in order to log to two (or more) files using the UNIX 'tee' command:

ErrorLog "|/usr/bin/tee -a /var/log/apache/error-1.log /var/log/apache/error-2.log"

share|improve this answer
I will try this. If I were to do ErrorLog "|/usr/bin/tee -a /var/log/httpd/ /var/log/httpd/unified_modsecurity-error_log", will the logs still roll over like how they do today? – Pat Sep 6 '13 at 0:49
facepalm logrotate should take care of the rotations. I'll give your solution a try, thanks! – Pat Sep 6 '13 at 2:16

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.