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.

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
</Location>

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

share|improve this question

migrated from stackoverflow.com Nov 12 '09 at 1:23

This question came from our site for professional and enthusiast programmers.

3 Answers 3

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.

share|improve this answer

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
RewriteCond %{REQUEST_METHOD} '^(OPTIONS|PROPFIND)$'
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.

share|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.

share|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

 
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.