[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: how can I redirect Subversion/apache msgs to a new file

From: michael <cs_at_networkingnewsletter.org.uk>
Date: Thu, 17 Jan 2008 14:49:04 +0000

On Thu, 2008-01-17 at 10:30 +0000, david.x.grierson_at_jpmorgan.com wrote:
> Works fine for me ... thanks for the idea :-)
>
> [16/Jan/2008:05:40:18 -0500] - update '/tags/DEV2'
> [16/Jan/2008:05:40:47 -0500] v026091 unlock '/tags/DEV2/README.txt'
> [16/Jan/2008:06:05:15 -0500] - remote-status '/trunk'
> [16/Jan/2008:06:05:42 -0500] v026091 commit r53
> [16/Jan/2008:06:10:41 -0500] - remote-status '/tags/DEV2'
> [16/Jan/2008:06:11:19 -0500] - switch '/tags/DEV2' '/trunk'
> [16/Jan/2008:06:11:24 -0500] - list-dir '/trunk/'
> [16/Jan/2008:06:11:26 -0500] - list-dir '/trunk/'
> [16/Jan/2008:06:11:32 -0500] - switch '/trunk' '/tags/DEV4'
> [16/Jan/2008:06:11:35 -0500] - switch '/tags/DEV4' '/tags/DEV2'
> [16/Jan/2008:06:11:38 -0500] - switch '/tags/DEV2' '/tags/DEV3'
> [16/Jan/2008:06:11:39 -0500] - switch '/tags/DEV3' '/tags/DEV1'
> [16/Jan/2008:06:11:43 -0500] - switch '/tags/DEV1' '/tags/DEV2'
>
> CustomLog logs/svn-actions.log "%t %u %{SVN-ACTION}e" env=SVN-ACTION
>
> I've even tried it using it as a pipe with rotatelog and that works fine
> too:
>
> CustomLog "|/usr/sbin/rotatelogs logs/svn-actions.log 86400" "%t %u
> %{SVN-ACTION}e" env=SVN-ACTION
>
> Need to expand it a wee bit to get the repository name into the log as
> well though.
>
> Dg.

David, KM (hope okay to CC you?) et al,

Glad you've both got it working. I'm using a Debian dist of Apache2
which, if I understand correctly, doesn't use httpd.conf but for general
stuff uses apache2.conf and for modules uses the relevant module conf
file eg mods-available/dav_svn.conf

I've attached my mods-available/dav_svn.conf which seems fine as far as
I can tell. (I've also tried the CustomLog in the apache2.conf but no
help) And here's the permissions set for the required logfile (you can
see that Apache2 has created it but then I changed the
permissions/ownership from root:root)
michael_at_ratty:/var/log/apache2$ lshead
total 7480
-rw-r----- 1 root adm 4890980 Jan 17 14:36 access.log
-rw-r----- 1 root adm 1428669 Jan 17 14:36 error.log
drwxr-xr-x 2 root root 4096 Jan 17 14:29 ./
-rw-rw-r-- 1 root www-data 0 Jan 17 14:29 subversion.log
drwxr-xr-x 17 root root 4096 Jan 17 06:26 ../

I run Apache2 as www-data:
michael_at_ratty:/var/log/apache2$ ps -elf|grep apache
1 S root 16548 1 0 78 0 - 2662 - 14:36 ?
00:00:00 /usr/sbin/apache2 -k start
5 S www-data 16549 16548 0 78 0 - 2605 375754 14:36 ?
00:00:00 /usr/sbin/apache2 -k start
5 S www-data 16550 16548 0 78 0 - 58136 pipe_w 14:36 ?
00:00:00 /usr/sbin/apache2 -k start
5 S www-data 16552 16548 0 82 0 - 58068 pipe_w 14:36 ?
00:00:00 /usr/sbin/apache2 -k start
0 S michael 16621 16237 0 78 0 - 819 pipe_w 14:38 pts/3
00:00:00 grep apache

Any ideas what I've overlooked?
Thanks, Michael

# dav_svn.conf - Example Subversion/Apache configuration
#
# For details and further options see the Apache user manual and
# the Subversion book.
#
# NOTE: for a setup with multiple vhosts, you will want to do this
# configuration in /etc/apache2/sites-available/*, not here.

# <Location URL> ... </Location>
# URL controls how the repository appears to the outside world.
# In this example clients access the repository as http://hostname/svn/
# Note, a literal /svn should NOT exist in your document root.

<Location /svn>
DAV svn

# Alternatively, use SVNParentPath if you have multiple repositories under
# under a single directory (/var/lib/svn/repo1, /var/lib/svn/repo2, ...).

SVNParentPath /usr/local/SUBVERSION

  # Access control is done at 3 levels: (1) Apache authentication, via
  # any of several methods. A "Basic Auth" section is commented out
  # below. (2) Apache <Limit> and <LimitExcept>, also commented out
  # below. (3) mod_authz_svn is a svn-specific authorization module
  # which offers fine-grained read/write access control for paths
  # within a repository. (The first two layers are coarse-grained; you
  # can only enable/disable access to an entire repository.) Note that
  # mod_authz_svn is noticeably slower than the other two layers, so if
  # you don't need the fine-grained control, don't configure it.

  # Basic Authentication is repository-wide. It is not secure unless
  # you are using https. See the 'htpasswd' command to create and
  # manage the password file - and the documentation for the
  # 'auth_basic' and 'authn_file' modules, which you will need for this
  # (enable them with 'a2enmod').
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
#MKB: all requests require valid user
Require valid-user

  # To enable authorization via mod_authz_svn
  #AuthzSVNAccessFile /etc/apache2/dav_svn.authz

  # The following three lines allow anonymous read, but make
  # committers authenticate themselves. It requires the 'authz_user'
  # module (enable it with 'a2enmod').
  #<LimitExcept GET PROPFIND OPTIONS REPORT>
    #Require valid-user
  #</LimitExcept>

</Location>

### not sure why following does not work
### #MKB: turn on custom logs for easier reading
CustomLog /var/log/apache2/subversion.log "%t %u %{SVN-ACTION}e" env=SVN-ACTION
LogFormat "%t %u %{SVN-ACTION}e" svn

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-01-17 15:49:34 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.