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 November 2005 09: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???? > >