log4net not writing file

Discussion in 'Windows / IIS' started by Warren, Nov 28, 2011.

  1. My application uses log4net, which writes to a file. It works fine under development, and under IIS on a Win7 machine. Once deployed to my DASP site however, it never writes. Am I missing a configuration or a permission setting?

    I'm writing to the App_Data folder, as the app should have write permissions there by default.

    If I need to set custom permissions, can you please explain how I do it in the DASP interface or otherwise.

    Any other tips on how to investigate the issue would be appreciated.

    Below are the pertinent parts of my web.config file.

    Code:
    <log4net>
        <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
          <file value="App_Data/Appliction.log"/>
          <appendToFile value="true"/>
          <rollingStyle value="Size"/>
          <maxSizeRollBackups value="10"/>
          <maximumFileSize value="100KB"/>
          <staticLogFileName value="true"/>
          <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline"/>
          </layout>
        </appender>
        <root>
          <level value="ALL"/>
          <appender-ref ref="RollingFileAppender"/>
        </root>
      </log4net>
    
     
  2. Thanks very much keikoraca, that did the trick.
     

Share This Page