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

Re: Re: libsvn_repos logging -- rethunk

From: Brian Holmes <svndev_at_gmail.com>
Date: 2005-07-20 04:29:02 CEST

On 7/15/05, Ben Collins-Sussman <sussman@collab.net> wrote:
> So Karl and I had another long chat, and now we're both thinking that
> perhaps this logging design conversation has wandered down a path that
> we're not so happy with.
> My last conclusion was based on ghudson's suggestion: "bah, apache
> already has errorlogs, let's just implement something similar within
> svnserve's private code."
> But now we're thinking that maybe this isn't so good.
> First, errors are generally just as specific to repositories as
> network requests. So if we think it's a good idea to have
> repos-specfic accesslogs, it's likely just as useful to have
> repos-specific errorlogs.
> Second, svnserve and apache aren't the only users of svn_repos_t.
> Other processes such as svnadmin, svnlook, viewcvs, or even 'svn
> file:///' may all want to log errors. This implies that it would be
> beneficial to have a public API for error-logging alongside the one
> for access-logging. (Which is what I originally drafted.)

So what you're say is there will be two handles (supposedly inside
svn_repos_t) for logging objects. Something like the following:

svn_logger_baton_t* perror_log;
svn_logger_baton_t* paccess_log;


svn_repos_log_access(repos, level, "message")
svn_repos_log_error(repos, level, "message")

Did I get that right?

So we're backtracking a bit, and proposing this more grandiose vision:
> I. Repositories have an accesslog and an errorlog.
> A. repository logs live in repos/logs/. By default, a
> repository has an accesslog and errorlog in there.
> B. repositories grow their own configuration file in
> repos/conf/, named 'repos.conf'. For now, the only thing in
> that file are two variables stating where accesslog and
> errorlog live.

From a cursory glance I like the this idea. However, when I start thinking
about it from a Subversion admin's perspective I feel like we might be
confusing them. Currently all Apache configuration is done through
httpd.conf. Now admins will have to start digging into the /repos/conf
folder which most have probably never done (I'm excluding svnserve admins.)
In addition, people have to modify every single repository they have (which
I find to be a *real* pain) if they want to customize their logging.
Honestly, I don't expect that to happen often. Even so, is there going to be
a way to override this in an httpd.conf? If someone can give me the warm
fuzzy feeling that we're actually doing something better for the SVN admins
out there instead of confusing them, I'm all for it.

II. Repos-specific public API for accesslog and errorlog
> A. svn_repos_open() parses repos/conf/repos.conf, and thus knows
> where the logs are. (If there is no repos.conf it creates
> one.)

I like this idea, but there needs to be a way to override this. We should
still be able to support a --foreground command that allows logging output
to be sent to STDOUT.

B. API allows user to identify itself to the svn_repos_t, so
> that terms like "mod_dav_svn" and "svnserve" can show up in
> logs.

I'm assuming this requires extending interfaces which would help to
accomodate the previous item.

C. API to write to errorlog and accesslog both take a
> svn_repos_t argument.

This is fine for code in svn_repos but this makes it seem like svn_repos is
the only module that will ever be writing log entries which I can't imagine
will (or should) be the case.

The objections people have brought up previously:
> 1. "What about errors (or access requests) that happen before we have
> an svn_repos_t?"
> Our feeling is that each process can decide how to handle those
> things on its own. A process may choose to:
> * not log such events at all
> * log them in a sensible global location
> * log them in location determined by a process-specific .conf
> file (such as svnserve.conf)

Here's an example of something occuring outside of svn_repos that should
probably use svn_log_write() instead of svn_repos_log_write(). There should
still be a generic log API that allows the controlling process to do all the
same logging that svn_repos_log_*() is going to do, but in its own manner.

2. "But mod_dav_svn is already logging errors to apache's errorlog."
> We can change mod_dav_svn to:
> * log repos-inspecific errors in apache's errorlog, and
> repos-specific ones in the repository's errorlog.
> * give administrators a choice: "would you like repository
> specific errors to be logged in the repository's errorlog,
> apache's errorlog, or both?"
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
- Brian Holmes
Received on Wed Jul 20 04:30:45 2005

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

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