Log4Net separate config file not working

前端 未结 2 1997
逝去的感伤
逝去的感伤 2021-02-15 15:27

I\'m having a strange problem. I have multiple projects in a solution. One of them is a WebAPI and it logs just fine. Another is an MVC admin site, this one won\'t log. Here

2条回答
  •  忘了有多久
    2021-02-15 15:52

    I had to setup the config file watcher in Application_Start:

    log4net.Config.XmlConfigurator.ConfigureAndWatch(new System.IO.FileInfo(AppDomain.CurrentDomain.BaseDirectory + "logging.config"));
    

    Turns out that DotNetOpenAuth.Core.dll uses log4net and will make using the AssemblyInfo solution not work. I found the details in this blog: http://hanskindberg.wordpress.com/2013/04/07/log4net-configuration/ (look at the paragraph that mentions DotNetOpenAuth.Core.dll)

提交回复
热议问题