RE: Log4Net file locking

2005-12-12 Thread Nicko Cadell
Make sure that you are opening the file for Read only and that you allow ReadWrite as the share mode, e.g. System.IO.File.Open(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); Nicko > -Original Message- > From: news [mailto:[EMAIL PROTECTED] On Behalf Of Sankalp > Sent: 22

Re: Log4Net file locking

2005-11-23 Thread Mike Blake-Knox
I'd suggest that you change the program that's displaying the log file so that it uses FileAccess.ReadWrite AND FileShare.ReadWrite when opening the file. Otherwise, you won't be able to open the file as it already has a writer. This generally works fine with the RollingFileAppender but note that

Re: Log4Net file locking

2005-11-22 Thread Ron Grabowski
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

RE: Log4Net file locking

2005-11-22 Thread Marc Lewandowski
Just a thought, since it seems like what you are attempting is a real-time logging scenario, why not use a different appender more suited to the task? You could retain the rolling-file appender, but for the RichTextBox you could display the contents of a console appender (if it is in the same proce

RE: Log4Net file locking

2005-11-22 Thread Christoph Walcher
,   FileMode mode,   FileAccess access,   FileShare share);   method of File?   greets Christoph From: Matthew Brown [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 22, 2005 2:46 PMTo: Log4NET UserSubject: Re: Log4Net file locking Just a warning though, in my experience with MinimalLock

Re: Log4Net file locking

2005-11-22 Thread Matthew Brown
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:(This must be inserted in the con

RE: Log4Net file locking

2005-11-22 Thread Georg Jansen
Hi, You can try to change the lock level: (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