Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

    ServerName mydomain.net
    ServerAlias www.mydomain.net mydomain.net
    DocumentRoot /var/www/html/mydomain
    ServerAdmin not@available.com
    UseCanonicalName Off

    ErrorLog logs/mydomain.net-error_log
    ErrorLog logs/unified_modsecurity-error_log

    CustomLog logs/mydomain.net-access_log combined
    UserDir disabled
    UserDir enabled mydomainuser
share|improve this question

1 Answer 1

up vote 3 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/mydomain.net-error_log /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.