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

libsvn_repos logging APIs (was Re: Proposal for Logging in Svnserve)

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2005-07-14 18:12:40 CEST

On Jul 13, 2005, at 10:29 AM, nick vajberg wrote:
>
> In general, I'd like the logging facility to be
> independent of server. That is, logging should work
> the same way whether running httpd or svnserve or
> something else.

It's funny that this thread came up, because over in Collabnet, we're
thinking about the same problem. We'd like to add some "high level"
logging to mod_dav_svn, because it turns out that simply reading the
apache accesslog isn't enough. It's a side effect of using WebDAV/
DeltaV. At most, you can see that a user was doing some reads or
writes. But, for example, 'svn checkout/update/switch/export/blame/
log/diff/merge' all look like a single REPORT request. Pretty useless.

The patch that Karl and I sent to the list in which the client
'declares' what it's doing was shot down, and rightfully so. Forget
about it. That leaves us only one avenue left: add new code to
mod_dav_svn to deduce and log client operations. For example,
mod_dav_svn already understands the 7 different types of HTTP REPORT
requests, so it can easily write to a log that "so-and-so did an
update", "so-and-so did a blame", etc.

I've been pondering ways to make svnserve and mod_dav_svn share as
much logging-code as possible, but the situation seems to be a bit grim.

In an ideal world, the different server implementations would only
ever call libsvn_repos, and then the logging ability could be
silently buried into all of svn_repos.h APIs. But we're not in the
ideal world. Our different server implementations call a mixture of
libsvn_repos and libsvn_fs functions, and they call them at different
times and in different ways. There's almost no shared logic at all.
I guess it's not surprising, since one server is doing a stateful
protocol, the other stateless.

So I think that the most we can hope for are some new svn_repos.h
APIs to make it "easier" for a server to write logs. At most, we can
work to guarantee that mod_dav_svn and svnserve produce logs that
look similar. I'm thinking of APIs like:

    - open/close a logfile
    - write a client-action into a logfile
    - write a debugging string into a logfile

I'd love to discuss/design these APIs.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jul 14 18:13:31 2005

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