Log4Net/C# - Disable default logging

前端 未结 2 936
庸人自扰
庸人自扰 2021-02-09 04:24

I am using log4net in a C# project, in the production environment, I want to disable all the logging, but when some fatal error occures it should log all the previous 512 messa

相关标签:
2条回答
  • 2021-02-09 05:07

    Do you still see the messages in Visual Studio if the application is compiled in release mode? It's possible that log4net uses Debug.Write to show the errors anyway. If that's the case then those messages shouldn't appear in release mode.

    0 讨论(0)
  • 2021-02-09 05:10

    Remove the BasicConfigurator.Configure() line. That's what that line does -- adds a ConsoleAppender pointing to Console.Out.

    0 讨论(0)
提交回复
热议问题