Very simple file appender logging not working

后端 未结 4 1983
感情败类
感情败类 2021-02-04 08:38

Here\'s my web.config information:

  
        
相关标签:
4条回答
  • 2021-02-04 09:03

    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)

    0 讨论(0)
  • 2021-02-04 09:14

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

    <root>
      <level value="ALL" />
      <appender-ref ref="RollingFileAppender" />
    </root>
    
    0 讨论(0)
  • 2021-02-04 09:14

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

    0 讨论(0)
  • 2021-02-04 09:24

    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>
    
    0 讨论(0)
提交回复
热议问题