0

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?

0

3 Answers 3

2

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.

2

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.

0

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.

2
  • CustomLog is not allowed within Location :( And Apache must log for the normal HTTP stuff. Commented Nov 12, 2009 at 4:06
  • That's true, but it's possible within a VirtualHost. Commented Nov 12, 2009 at 15:42

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.