I just saw this blog entry that suggest using %processid. This would be ideal...
http://piers7.blogspot.com/2006/02/using-log4nets-fileappender-in-web.html
<appender name="File" type="log4net.Appender.RollingFileAppender">
<file type="log4net.Util.PatternString"
value="C:\temp\MyApp_[%processid].log" />
However, on my system, using
<appender name="Loadtest.Debug"
type="log4net.Appender.RollingFileAppender, log4net, Version=1.2.9.0,
Culture=neutral, PublicKeyToken=b32731d11ce58905">
<param name="File" value=".\[%processid]LoadTest.log" />
Created a file name " [%processid]LoadTest.log", and showed same locking
contentions.
We have to use rollingfileappenders, because our customers require us to have
NO additional dependencies on databases.
-----Original Message-----
From: Ron Grabowski [mailto:[EMAIL PROTECTED]
Sent: Monday, November 13, 2006 5:18 PM
To: Log4NET User
Subject: Re: RollingFileAppender & concurrency
Are you generating a lot of logs? Keep in mind that the RollingFileAppender is
not a database. Have you looking using something like MSDE and the
AdoNetAppender as a storage place for logs on each machine? This link shows how
to setup an alternate locking model on a FileAppender:
http://logging.apache.org/log4net/release/config-examples.html#fileappender
Opening and closing a file after each write will never be as fast as an
exclusive lock.
----- Original Message ----
From: Steve Burkett <[EMAIL PROTECTED]>
To: [email protected]
Sent: Monday, November 13, 2006 6:50:25 PM
Subject: RollingFileAppender & concurrency
Hello,
We have a .Net v2 asp.net webservice that uses log4net. Our customers want
to run our product in a webgarden (multiple processes running on the same
machine). Each process, uses the same web.config, and thus the same
RollingFileAppender file name.
Will the service interleave the log calls to the single file correct? (a
simple test I did with a console app, running in two windows, didn’t interleave
correctly).
Is there a switch on RollingFileAppender to allow concurrency? Another
(file based) appender?
Thanks! J
=======
Notice: This e-mail message, together with any attachments, contains
information of Symyx Technologies, Inc. or any of its affiliates or
subsidiaries that may be confidential, proprietary, copyrighted,
privileged and/or protected work product, and is meant solely for
the intended recipient. If you are not the intended recipient, and
have received this message in error, please contact the sender
immediately, permanently delete the original and any copies of this
email and any attachments thereto.