22

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?

John Magnolia
  • 1,723
  • 6
  • 28
  • 46

3 Answers3

39

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>
user9517
  • 115,471
  • 20
  • 215
  • 297
0

On Ubuntu

sudo a2disconf other-vhosts-access-log
Vitalicus
  • 99
  • 1
0

Change /etc/apache2/conf-enabled/other-vhosts-access-log.conf to following:

ErrorLog /dev/null

CustomLog /dev/null common
Izac
  • 1,758
  • 1
  • 11
  • 11
  • 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 08:35