One of our developers (Eric Borman) researched this recently, so I'll quote him:

The short answer is that log4net is thread safe, the appenders are not. log4net 
takes this into account and ensures proper serialization of logging events. So 
as long as you use the logging API and don't access the appender directly you 
are safe.

http://stackoverflow.com/questions/1519211/multithread-safe-logging
http://www.l4ndash.com/Log4NetMailArchive%2Ftabid%2F70%2Fforumid%2F1%2Fpostid%2F17279%2Fview%2Ftopic%2FDefault.aspx

However,
That does not make them process safe. So using a web garden will cause 
collisions.

http://hectorcorrea.com/blog/log4net-thread-safe-but-not-process-safe

Thanks,
_________________________________
Bill Sorensen
Patterns, Platforms and Practices
Integrated DNA Technologies
www.idtdna.com

From: Rafael Thome Guimaraes [mailto:[email protected]]
Sent: Thursday, September 05, 2013 3:49 PM
To: Log4NET User
Subject: Thread Safety in Log

Hi all!

Anyone knows if Log4Net is Thread Safe or I need to put locks in the calls?

Tks,
Rafael Thomé Guimarães

Reply via email to