Very simple file appender logging not working

假装没事ソ 提交于 2019-12-02 23:24:51

I found the answer: I needed the requirePermission="false" tag in my web.config's configuration seciton.

<configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" **requirePermission="false"**/>
</configSections>

As far as I can see you are missing an appender for root:

<root>
  <level value="ALL" />
  <appender-ref ref="RollingFileAppender" />
</root>

I had to call fileAppender.ActivateOptions() to get it logging

Is it possible to run Debug View on the webserver?

If so, you may be able to see if log4net is reporting any errors (such as an access error or a error reading the configuration file)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!