How do I get the SVN server log?

CrazyCoder picture CrazyCoder · Aug 8, 2012 · Viewed 26.6k times · Source

I am trying to find a way to get the SVN server-side log, but I only found the way to retrieve the client side logs using svn:log. How do I get the server-side logs?

Answer

Ben Johnson picture Ben Johnson · Aug 5, 2014

For SVN implementations that utilize the svnserve executable, it is possible to enable server-side logging by passing the --log-file switch when starting the daemon, e.g.:

# svnserve -d -r /svn --log-file=/var/log/svnserve.log

This would cause the svnserve daemon to log to the file /var/log/svnserve.log.

For the sake of thoroughness, the -d switch runs svnserve in "Daemon Mode", and the -r switch specifies the SVN repository root.

To take my response a step further, it is possible to configure svnserve as a service. This ensures that svnserve runs on system start-up, and is terminated gracefully on system shutdown.

One method to accomplish this on Debian (and Ubuntu) systems is described at http://odyniec.net/articles/ubuntu-subversion-server/ , and the author provides an initd script that should function correctly out-of-the-box: http://odyniec.net/articles/ubuntu-subversion-server/svnserve

For those who employ this script, logging can be enabled by modifying the DAEMON_ARGS variable on line 18 (as of this writing) to look something like:

DAEMON_ARGS="-d -r /svn --log-file=/var/log/svnserve.log"

The service would then be started with

# service svnserve start

and stopped with

# service svnserve stop

The script also accepts the restart and force-reload arguments.