Log4net does not write the log in the log file

后端 未结 13 2583
一生所求
一生所求 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:00

    For me I had to move Logger to a Nuget Package. Below code need to be added in NuGet package project.

    [assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config")]
    

    See https://gurunadhduvvuru.wordpress.com/2020/04/30/log4net-issues-when-moved-it-to-a-nuget-package/ for more details.

提交回复
热议问题