logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Lewandowski" <m...@telebill.com>
Subject RE: Log4Net file locking
Date Tue, 22 Nov 2005 21:03:29 GMT
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
process) or a remoting or UDP appender (if logging and viewing are in
separate processes).

Another thought: if you do want to be able to view the file, you should just
be able to open the file in a read-only fashion without using the (somewhat
expensive) minimal lock option.  I've noticed that I can open log files in
Notepad while they are still being written to by L4N.

-Marc

-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Sankalp
Sent: Tuesday, November 22, 2005 4:53 AM
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????


Mime
View raw message