Friday, May 18, 2012
 
The best way to analyze your logs! Minimize
 Log4Net Mail archive   

The Log4Net mailing list is a great source of information about using log4Net, in this forum we collect all the messages in the log4net user list and some selected threads from the developer list.

Subject: Same file read/write from Multiple process
Prev Next
You are not authorized to post a reply.

Author Messages
Pradeeptp

09/11/2008 2:27 PM  

 

Hi All,

I am considering to use Log4Net in a web service to write to a single log
file. I want to know whether writing to a single file in this manner through
Log4Net is safe.  The current code I have implemented is in C# in which I am
writing to a single file which gives me error "The process cannot access the
file XXXXX because it is beign used by another process"

To resolve the above problem I am considering using Log4Net.  If anyone has
any experience in using Log4Net please confirm me that this error will not
happen in Log4Net.

Thanks
pradeeptp

Ron Grabowski

09/11/2008 6:16 PM  

Log4net supports a pluggable file locking mechanism. The default implementation is to use an exclusive lock. You should consider using a MinimalLock:

 http://logging.apache.org/log4net/release/sdk/log4net.Appender.FileAppender.MinimalLock.html

which would allow multiple processes to write to it.

 

Pradeeptp

09/16/2008 9:27 AM  


Hi Ron,

I checked the link provided by you.  The document says that MinimalLock is
not thread safe.

(PS: I clicked on your reply but I didnt see any reply link to reply to your
message, so I am replying to my own message).

rgds
Pradeep

You are not authorized to post a reply.
Forums > Log4Net > Log4Net Mail archive > Same file read/write from Multiple process



ActiveForums 3.7

 

 

 

 

 

 

 

 

Log4Net Dashboard

Log analysis and monitoring made easy!

Log4Net Dashboard is a log viewer that can read log statements from a variety of logging output targets.

You can download a free developer version.

  

Check it out!

On the demonstration site you can try it  with live data.demo.l4ndash.com - Try Log4Net Dashboard with live data

The mail archive is a copy of all the mail sent to the mail address: log4net-user@logging.apache.org, organized as a forum.

If you would like to participate in the mail list, send a mail to log4net-user-subscribe@logging.apache.org.

More information about the mailing list is available on: http://logging.apache.org/log4net/support.html

 

A complete topic list is available and can be viewed here (warning, it takes some time to load)

 

Copyright 2005-2008 by FaktNet AS Terms Of Use Privacy Statement