Thread Safety of log4net

前端 未结 3 1476
傲寒
傲寒 2021-02-02 11:38

There seems to be some discussion on whether log4net is thread-safe, the consensus is that the framework is thread-safe, but appenders are not and need to be used correctly to a

3条回答
  •  误落风尘
    2021-02-02 12:13

    But I've had a deadlock with ColoredConsoleAppender. And it sources comment states that internal writer (m_consoleOutputWriter) is not thread safe!

    /// 
    /// The console output stream writer to write to
    /// 
    /// 
    /// 
    /// This writer is not thread safe.
    /// 
    /// 
    private System.IO.StreamWriter m_consoleOutputWriter = null;
    

    And I've switched back to basic ConsoleAppender and have no issues since then.

提交回复
热议问题