assembly+log4net.config配置,先加入的WEB项目中,之后想在DAL也输出日志,但始终无法输出,
引入Log4net源码项目调试,发现Log.IsDebugEnable IsInfoEnable等全部都是false。
最后解决,在每个引用log4net.dll项目均需加入assembly。
最后配置
Web项目及DAL的AssmblyInfo.cs均加入
[assembly:log4net.Config.XmlConfigurator(ConfigFile="log4net.config",Watch=true)]
只在web项目中加入
log4net.config
转一篇有用的配置博客