I’ve got Subversion installed as an Apache module and it is set up and works just fine. The only problem is that I get all of the SVN stuff (eg PROPFIND, OPTIONS, etc.) logged to the same .LOG file as normal web accesses. I am trying to figure out how to get the SVN module to report to a custom log file.
Here is the part of my Apache conf file that loads the SVN module. I tried doing it with the CustomLog directive (as seen at the bottom), but that did not work.
################################################
#Subversion modules
LoadModule dav_svn_module "C:/SVN/bin/mod_dav_svn.so"
LoadModule authz_svn_module "C:/SVN/bin/mod_authz_svn.so"
# Configure Subversion repository
# This configures Apache so that all your Subversion repositories
# are available at http://myserver/svn/[repositoryName]
# The access is restricted to known users/passwords.
<Location /svn/>
DAV svn
SVNIndexXSLT "/svnindex.xsl"
SVNParentPath "C:/SVNRep/Repository/"
SVNListParentPath on
# SVNPath "C:/SVNRep/Repository/" #for single repository
SVNPathAuthz off
# SVNMasterURI http://localhost/svn/ #for write-through proxying
AuthType Basic
AuthName "My Subversion repositories"
AuthUserFile "C:/SVNRep/passwd"
Require valid-user
AuthzSVNAccessFile "C:/SVNRep/acl"
</Location>
CustomLog "C:/Logs/Apache/SVN.log" "%t %u %{SVN-ACTION}e" env=SVN-ACTION
################################################
Any ideas?
Thanks a lot.
Except for the log path different from *nix to Windows what you have is exactly what I have configured and works on various servers - possibly the SVN-ACTION isn't making its way into env on windows? As a workaround you could try:
This obviously won't be as friendly as logging %{SVN-ACTION}e but it will split all requests to /svn to their own log.
Well I figured it out. After a lot of searching (which found a few others asking the same thing, but not as many as I would have expected), I came up with the solution by serendipity. While watching a show, during the commercial I got to thinking about what it would take to completely segregate Subversion from the web server (as in a separate server altogether). Then I wondered why the Subversion entries were flooding the web server logs while my other VirtualHosts were not (they were using their own logs as desired). Then it hit me: I have SVN set up in the main web server, not a Virtual Host! So that is the answer.
To have Subversion log to its own LOG file and not flood the main Apache log file, just put the SVN directives (eg Location…) in its own, dedicated Virtual Host.
This way, I can connect to the SVN virtual host with the SVN client, and to the web server with a web browser. Duh. :) So simple; no hacks, no workarounds, nothing. It’s curious why putting the SVN location in a Virtual Host doesn’t seem to be in many examples—I saw it in only one! out of a couple of dozen examples.
(Of course the main log files will still get OPTIONS, PROPFIND, etc. entries if you try to connect to it with an SVN client, but that is correct behavior.)
Here is an example:
There you have it. Now I wonder if I can track down those people that asked this question…