I have an Apache running as HTTP server and also a SVN server which is delivered by the same Apache machine.

Configured with something like

<Location /repos>
      DAV svn
      SVNParentPath /srv/repos

How can I prevent Apache to log all the SVN "PROPFIND" and "OPTIONS" access requests?


I thought there wasn't a way to do this, but turns out there might be. The CustomLog directive can look for the existence of an environment variable to decide to log the request or not. Combine that with mod_rewrite to set that environment variable, and I think you have what you're looking for.

RewriteEngine On
RewriteRule ^/repos - [E=skiplog:1]
CustomLog /log/file/path common env=!skiplog

I haven't tested this. From what I'm reading in the docs though, this should work.

| improve this answer | |

This is similar to the Rewrite method, but just uses the SetEnvIf directives to mark OPTIONS and PROPFIND requests in the relevant vhost, then we add the env rule to the access log to exclude them from the access log.

SetEnvIf Request_Method "OPTIONS" dontlog
SetEnvIf Request_Method "PROPFIND" dontlog
CustomLog /path/to/access_log combined env=!dontlog

We went this route for a continuous build system that did excessive polling. We're actually working on changing things around to use SVN post-commit hooks to notify the build system of changes.

| improve this answer | |

You should be able to add:

ErrorLog /dev/null
CustomLog /dev/null combined

To whatever vhost container you're using. If you're not using a vhost for SVN, you may have a difficult time doing this.

| improve this answer | |
  • CustomLog is not allowed within Location :( And Apache must log for the normal HTTP stuff. – powtac Nov 12 '09 at 4:06
  • That's true, but it's possible within a VirtualHost. – zero_r Nov 12 '09 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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