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

Re: Need logging facilities

From: <gstein_at_lyra.org>
Date: 2003-01-24 04:00:25 CET

On Thu, Jan 23, 2003 at 08:46:08PM -0500, Brandon Ehle wrote:
 I need to implement some server side logging facilities to track down a
 bug in mod_dav_svn and was wondering if anyone had any suggestions on
 the best way to implement this? I don't want to send the information to
 the httpd log files because I need to log the interaction between
 ra_local ra_dav mod_dav_svn, so I need something that will store the
 log messages from the different processes in the order that they are

I've done this before, and it gets a bit tricky when you're dealing with
different processes. The big problem is that two processes will open a file
for appending at the same time. They each think they're at the end of the
file, they both write, and one ends up overwriting the other.

My solution was to use the 'mkfifo' command to create a pipe in the
filesystem. The apps would then open() the fifo and shove data into it. The
data that enters the fifo is synchronized; it won't overwrite each other,
but it can definitely end up interleaved.

To empty the fifo, I just did:

$ cat /tmp/the-fifo /tmp/the-log

After your run, all the data will be sitting in the-log. Just kill the 'cat'
process when you're done to ensure the data is flushed to the-log.


Greg Stein, http://www.lyra.org/
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 14 02:11:43 2006

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.