Log4net does not write the log in the log file

后端 未结 13 2307
一生所求
一生所求 2020-11-29 17:09

I have created a simple scenario using Log4net, but it seems that my log appenders do not work because the messages are not added to the log file.

I added the followi

相关标签:
13条回答
  • 2020-11-29 18:02

    Make sure the following line code should be there in AssemblyInfo.cs file.

    [assembly: log4net.Config.XmlConfigurator(ConfigFile = "Web.config", Watch = true)]

    and also check for this line in Application_start() method.

    log4net.Config.XmlConfigurator.Configure();
    
    0 讨论(0)
提交回复
热议问题