log4net is thread safe as it says in the FAQ. 

How log4net implements this with regards to individual appenders is not
really important. The docs for the RollingFileAppender are correct, the
members of the type are not thread safe, but this is not relevant unless
you want to programmatically access the appender directly from you code.
During logging the appender's base class (AppenderSkeleton) ensures
serialisation of appending of logging events.

You do not need to add your own locking code around calls like:

log.Info("message");

or

LogManager.GetLogger("foo");

Cheers,
Nicko

> -----Original Message-----
> From: just_a_w [mailto:[EMAIL PROTECTED] 
> Sent: 02 March 2006 17:01
> To: [email protected]
> Subject: RollingFileAppender thread safety
> 
> I need to use the RollingFileAppender in a multi-threaded 
> application.  The documentation is a little confusing when it 
> comes to thread safety.  The general FAQ says log4net is 
> thread-safe, but the appender's documentation says it's not.
> 
> Does anyone have any suggestions on how to use the 
> RollingFileAppender in a multi-threaded application?  Do I 
> need to modify and try to compile the code myself?  Or should 
> I do something drastic, like synchronize access to the logger?
> 
> Thanks.
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection 
> around http://mail.yahoo.com 
> 

Reply via email to