I wonder if it would be worthwhile to make a ModestLock that locks the file for a few seconds after the last log in anticipation of another log message. When recording a lot of messages you'd benefit from having an exclusive lock during a lot of messages then when the system has slowed down some (i.e. no messages in 2+ seconds) it releases the lock. Maybe that time period would be need to be tweaked or configurable.
--- Matthew Brown <[EMAIL PROTECTED]> wrote: > Just a warning though, in my experience with MinimalLock, it slows > down > execution of the program significantly (as log4net has to lock the > file, > write it, unlock it, repeat) > > On 11/22/05, Georg Jansen <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > You can try to change the lock level: > > > > <lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> > > > > (This must be inserted in the config file in the section where you > define > > the RollingFileAppender). > > > > > > Best regards > > Georg > > http://www.l4ndash.com - Log4Net Dashboard / Log Viewer > > > > -----Original Message----- > > From: news [mailto:[EMAIL PROTECTED] On Behalf Of Sankalp > > Sent: 22. november 2005 10:53 > > To: log4net-user@logging.apache.org > > Subject: Log4Net file locking > > > > Hi, > > We wish to port our .NET windows application logging to Log4Net but > are > > facing a > > problem. Our application dispays the log file in a rich text box so > that > > the > > user can debug himself what all is happening in the application. We > plan > > to > > user > > RollingFileAppender so that logs can remain for certain period pf > time. > > However, there is some problem here. When we try reading the log > file and > > display it in the rich text box, then it says that the file is in > use and > > cant > > be accessed. Log4Net is putting a lock on the file. I tried > changing the > > locking > > level to Minimal Lock using a file Appender but even that didnt > help as as > > soon > > as the log is written, we simultaneoulsy display it in the rich > text box. > > Pointers any one???? > > > > > > > > >