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

If I dont set a error log inside a virtual host it will default to the default error/access log. Is there a way to turn this off for one virtual host?

share|improve this question
add comment

3 Answers

up vote 6 down vote accepted

Within your <VirtualHost> block for the vhost in question you can configure the logs to be sent to /dev/null

<VirtualHost *:80>
     ServerName nologserver.tld

     ErrorLog /dev/null
     CustomLog /dev/null common
</VirtualHost>
share|improve this answer
add comment
ErrorLog /dev/null

CustomLog /dev/null 

Should work for you

share|improve this answer
    
I get the following error when restarting apache after this change: Syntax error on line 71 of /etc/apache2/sites-enabled/example.com: CustomLog takes two or three arguments, a file name, a custom log format string or format name, and an optional "env=" clause (see docs) –  John Magnolia Sep 17 '11 at 8:35
add comment

Simply comment out the

ErrorLog
CustomLog

Directives in your virtual host config file or as guys suggested send log data to /dev/null

share|improve this answer
2  
anonymous comment left inline, moving to a comment: "Commenting out ErrorLog and CustomLog lines will result to log all events to common log (defined in main httpd.conf file). The only solution is to put the logs to /dev/null." –  slm Aug 29 '13 at 22:06
add comment

Your Answer

 
discard

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.