10

我正在尝试找到一种获取 SVN服务器端日志的方法,但我只找到了使用svn:log. 如何获取服务器端日志?

4

1 回答 1

13

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.

于 2014-08-05T20:43:06.093 回答