title: Log4Net not creating a log file
body: <p>I am using log4net to log the error  in my application.But the log file is not getting created.As far as I can see,the code is fine.</p>
  
  <p>Web.config code</p>
  
  <pre><code> &lt;configSections&gt;
      &lt;!-- For more information on Entity Framework configuration, visit  http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;
      &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt;
      &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/&gt;
  &lt;/configSections&gt;
  &lt;log4net&gt;
  &lt;appender name="Console" type="log4net.Appender.ConsoleAppender"&gt;
      &lt;layout type="log4net.Layout.PatternLayout"&gt;
          &lt;!-- Pattern to output the caller's file name and line number --&gt;
          &lt;conversionPattern value="%5level [%thread] (%file:%line) - %message%newline" /&gt;
      &lt;/layout&gt;
  &lt;/appender&gt;
  &lt;appender name="RollingFile" type="log4net.Appender.RollingFileAppender"&gt;
      &lt;file value="C:\Demo\example.log" /&gt;
      &lt;appendToFile value="true" /&gt;
      &lt;maximumFileSize value="100KB" /&gt;
      &lt;maxSizeRollBackups value="2" /&gt;
      &lt;layout type="log4net.Layout.PatternLayout"&gt;
          &lt;conversionPattern value="%level %thread %logger - %message%newline" /&gt;
      &lt;/layout&gt;
  &lt;/appender&gt;
  &lt;root&gt;
      &lt;level value="DEBUG" /&gt;
      &lt;appender-ref ref="Console" /&gt;
      &lt;appender-ref ref="RollingFile" /&gt;
  &lt;/root&gt;
  &lt;/log4net&gt;
  </code></pre>
  
  <p>In the AssemblyInfo.cs file,I have added the following code</p>
  
  <pre><code> [assembly: log4net.Config.XmlConfigurator(ConfigFile = "Web.config", Watch = true)]
  </code></pre>
  
  <p>In the class where I want to track the errors,I have added the following code</p>
  
  <pre><code>  private static readonly ILog logger = LogManager.GetLogger(typeof(ProviderRepository));
  </code></pre>
  
  <p>I am using the logger as so in the catch block.</p>
  
  <pre><code> logger.Error(Ex.Message);
  </code></pre>
  
  <p>But I dont see the Log file.Am I doing something wrong here?</p>