Search code examples
log4netappender

log4net is single threaded?


Reading the docs on log4net, I noticed that all the std Appenders are labeled as

"not safe for multithreaded operations"

This makes it sound like none of the Appenders can be used in ASP.Net or a multi-threaded client.

Am I mis-reading this? Has anyone encountered problems with threaded log4net Appenders??

Thanks --- Chris


Solution

  • From Log4Net FAQ:

    Is log4net thread-safe?

    Yes, log4net is thread-safe.

    I have used log4net in many ASP.NET applications without any problems getting a logger with:

    private static readonly ILog log = LogManager.GetLogger(typeof(MyLogger));