{"id":270,"date":"2011-04-24T23:35:37","date_gmt":"2011-04-25T04:35:37","guid":{"rendered":"synetech.ddns.net\/blogs\/smarticles\/?p=270"},"modified":"2011-04-24T23:40:17","modified_gmt":"2011-04-25T04:40:17","slug":"disable-logging-in-an-apache-virtualhost","status":"publish","type":"post","link":"https:\/\/synetech.ddns.net\/blogs\/smarticles\/2011\/04\/24\/disable-logging-in-an-apache-virtualhost\/","title":{"rendered":"Disable Logging in an Apache VirtualHost"},"content":{"rendered":"<p>VirtualHosts and logs are invaluable features of a web server. However, you may not always want to log things for <em>every<\/em> VirtualHost. If you simply comment out the logging commands of a VirtualHost, then transfers to and from the VH will be logged to the main (ie, parent) log file; commenting them does not disable logging for a VirtualHost.<\/p>\n<p>If you want to disable logging for a VirtualHost, one option is to log to a file in a temporary directory that gets flushed regularly, but a better solution is instead to have it log to a non-existent file (<code>nul<\/code> in Windows, <code>\/dev\/null<\/code> in *nix\/Mac), such as in the following\u2014mixed example\u2014commands:<br \/>\n<code><br \/>\n\t&lt;VirtualHost \u2026&gt;<br \/>\n\t\t\u2026<br \/>\n\t\tErrorLog\tnul<br \/>\n\t\tCustomLog\t\"nul\"\t\tcommon<br \/>\n\t\tCustomLog\tdev\/nul\t\treferer<br \/>\n\t\tCustomLog\t\"dev\/nul\"\tagent<br \/>\n\t\t\u2026<br \/>\n\t&lt;\/VirtualHost&gt;<br \/>\n<\/code><\/p>\n<div class=\"tagcloud\"><a href=\"https:\/\/synetech.ddns.net\/blogs\/smarticles\/tag\/computers\/\" rel=\"tag\">Computers<\/a>, <a href=\"https:\/\/synetech.ddns.net\/blogs\/smarticles\/tag\/software\/\" rel=\"tag\">Software<\/a><\/div>","protected":false},"excerpt":{"rendered":"<p>VirtualHosts and logs are invaluable features of a web server. However, you may not always want to log things for every VirtualHost. If you simply comment out the logging commands of a VirtualHost, then transfers to and from the VH will be logged to the main (ie, parent) log file; commenting them does not disable [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[14,38],"class_list":["post-270","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-computers","tag-software"],"_links":{"self":[{"href":"https:\/\/synetech.ddns.net\/blogs\/smarticles\/wp-json\/wp\/v2\/posts\/270","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/synetech.ddns.net\/blogs\/smarticles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/synetech.ddns.net\/blogs\/smarticles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/synetech.ddns.net\/blogs\/smarticles\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/synetech.ddns.net\/blogs\/smarticles\/wp-json\/wp\/v2\/comments?post=270"}],"version-history":[{"count":0,"href":"https:\/\/synetech.ddns.net\/blogs\/smarticles\/wp-json\/wp\/v2\/posts\/270\/revisions"}],"wp:attachment":[{"href":"https:\/\/synetech.ddns.net\/blogs\/smarticles\/wp-json\/wp\/v2\/media?parent=270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/synetech.ddns.net\/blogs\/smarticles\/wp-json\/wp\/v2\/categories?post=270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/synetech.ddns.net\/blogs\/smarticles\/wp-json\/wp\/v2\/tags?post=270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}