title: Application does not log
body: <p>I have a number of ASP.NET applications that use log4net without issue. I have not been able to get log4net to log anything in any of the services I wrote using the MVC libraries. I have the configuration identical (aside from log file name) in all the services. Each service is running as the same user and use the same application pool. </p>
  
  <p>Here is the configuration I am using:</p>
  
  <pre><code>&lt;log4net&gt;
          &lt;appender name="XMLAppender" type="log4net.Appender.RollingFileAppender"&gt;
              &lt;file value="C:\logs\SERVICENAME.Log.xml"/&gt;
              &lt;appendToFile value="true"/&gt;
              &lt;rollingStyle value="Composite"/&gt;
              &lt;datePattern value="yyyyMM"/&gt;
              &lt;maxSizeRollBackups value="10"/&gt;
              &lt;maximumFileSize value="100MB"/&gt;
              &lt;layout type="log4net.Layout.XmlLayoutSchemaLog4j"&gt;
                  &lt;locationInfo value="false"/&gt;
              &lt;/layout&gt;
      &lt;/appender&gt;
          &lt;root&gt;
              &lt;level value="INFO"/&gt;
              &lt;appender-ref ref="XMLAppender"/&gt;
          &lt;/root&gt;
      &lt;/log4net&gt;
  </code></pre>
  
  <p>I have the configSection entry in all, as follows:</p>
  
  <pre><code>&lt;configSections&gt;
      &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/&gt;
  ...
  &lt;/configSections&gt;
  </code></pre>
  
  <p>I have also turned on log4net debugging and set system.diagnostics to write the trace to a file. Here is where I see a difference in the output between the MVC and non-MVC applications. </p>
  
  <p>MVC:</p>
  
  <pre><code>log4net: log4net assembly [log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821]. Loaded from [C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\MVCSERVICENAME\25c1b478\883641ac\assembly\dl3\707a9005\e1887c7f_5040ca01\log4net.DLL]. (.NET Runtime [2.0.50727.3074] on Microsoft Windows NT 6.0.6002 Service Pack 2, v.286)
  log4net: DefaultRepositorySelector: defaultRepositoryType [log4net.Repository.Hierarchy.Hierarchy]
  log4net: DefaultRepositorySelector: Creating repository for assembly [MVCSERVICENAME, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]
  log4net: DefaultRepositorySelector: Assembly [MVCSERVICENAME, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] Loaded From [C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\MVCSERVICENAME\25c1b478\883641ac\assembly\dl3\13a19b30\fdb642f4_937dca01\MVCSERVICENAME.DLL]
  log4net: DefaultRepositorySelector: Assembly [MVCSERVICENAME, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] does not have a RepositoryAttribute specified.
  log4net: DefaultRepositorySelector: Assembly [MVCSERVICENAME, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy]
  log4net: DefaultRepositorySelector: Creating repository [log4net-default-repository] using type [log4net.Repository.Hierarchy.Hierarchy]
  log4net: Hierarchy: Shutdown called on Hierarchy [log4net-default-repository]
  </code></pre>
  
  <p>Non-MVC(Working):</p>
  
  <pre><code>log4net log4net assembly [log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821]. Loaded from [C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\SERVICENAME\33034378\c825df91\assembly\dl3\fe97001a\e1887c7f_5040ca01\log4net.DLL]. (.NET Runtime [2.0.50727.3074] on Microsoft Windows NT 6.0.6002 Service Pack 2, v.286)
  log4net DefaultRepositorySelector: defaultRepositoryType [log4net.Repository.Hierarchy.Hierarchy]
  log4net DefaultRepositorySelector: Creating repository for assembly [SERVICENAME, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]
  log4net DefaultRepositorySelector: Assembly [SERVICENAME, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] Loaded From [C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\SERVICENAME\33034378\c825df91\assembly\dl3\827ed068\1a38e2eb_fc7cca01\SERVICENAME.DLL]
  log4net DefaultRepositorySelector: Assembly [SERVICENAME, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] does not have a RepositoryAttribute specified.
  log4net DefaultRepositorySelector: Assembly [SERVICENAME, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy]
  log4net DefaultRepositorySelector: Creating repository [log4net-default-repository] using type [log4net.Repository.Hierarchy.Hierarchy]
  log4net XmlConfigurator: configuring repository [log4net-default-repository] using .config file section
  log4net XmlConfigurator: Application config file is [C:\content\SERVICENAME\web.config]
  log4net XmlConfigurator: Configuring Repository [log4net-default-repository]
  log4net XmlHierarchyConfigurator: Configuration update mode [Merge].
  log4net XmlHierarchyConfigurator: Logger [root] Level string is [INFO].
  log4net XmlHierarchyConfigurator: Logger [root] level set to [name="INFO",value=40000].
  log4net XmlHierarchyConfigurator: Loading Appender [XMLAppender] type: [log4net.Appender.RollingFileAppender]
  log4net XmlHierarchyConfigurator: Setting Property [File] to String value [C:\Windows\Temp\SERVICENAME.Log.xml]
  log4net XmlHierarchyConfigurator: Setting Property [AppendToFile] to Boolean value [True]
  log4net XmlHierarchyConfigurator: Setting Property [RollingStyle] to RollingMode value [Composite]
  log4net XmlHierarchyConfigurator: Setting Property [DatePattern] to String value [yyyyMM]
  log4net XmlHierarchyConfigurator: Setting Property [MaxSizeRollBackups] to Int32 value [10]
  log4net XmlHierarchyConfigurator: Setting Property [MaximumFileSize] to String value [100MB]
  log4net XmlHierarchyConfigurator: Setting Property [LocationInfo] to Boolean value [False]
  log4net XmlHierarchyConfigurator: Setting Property [Layout] to object [log4net.Layout.XmlLayoutSchemaLog4j]
  log4net RollingFileAppender: Type = [0], r0 = [197001], r1 = [197001]
  log4net RollingFileAppender: Type = [1], r0 = [197001], r1 = [197001]
  log4net RollingFileAppender: Type = [2], r0 = [197001], r1 = [197001]
  log4net RollingFileAppender: Type = [3], r0 = [197001], r1 = [197001]
  log4net RollingFileAppender: Type = [4], r0 = [197001], r1 = [197001]
  log4net RollingFileAppender: Type = [5], r0 = [197001], r1 = [197002]
  log4net RollingFileAppender: Searched for existing files in [C:\Windows\Temp]
  log4net RollingFileAppender: curSizeRollBackups starts at [0]
  log4net RollingFileAppender: [200912] vs. [200912]
  log4net FileAppender: Opening file for writing [C:\Windows\Temp\SERVICENAME.Log.xml] append [True]
  log4net XmlHierarchyConfigurator: Created Appender [XMLAppender]
  log4net XmlHierarchyConfigurator: Adding appender named [XMLAppender] to logger [root].
  log4net XmlHierarchyConfigurator: Hierarchy Threshold []
  log4net DefaultRepositorySelector: Creating repository for assembly [SERVICENAME.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]
  log4net DefaultRepositorySelector: Assembly [SERVICENAME.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] Loaded From [C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\SERVICENAME\33034378\c825df91\assembly\dl3\d74dc9d5\8aa6a7e8_fc7cca01\SERVICENAME.Core.DLL]
  log4net DefaultRepositorySelector: Assembly [SERVICENAME.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] does not have a RepositoryAttribute specified.
  log4net DefaultRepositorySelector: Assembly [SERVICENAME.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null] using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy]
  log4net DefaultRepositorySelector: repository [log4net-default-repository] already exists, using repository type [log4net.Repository.Hierarchy.Hierarchy]
  </code></pre>
  
  <p>In both cases I am creating the ILog object as follows:</p>
  
  <p>private static readonly ILog log = LogManager.GetLogger(typeof(CLASSNAME));</p>
  
  <p>Is there something I am missing or some change I need to make to get this working for MVC? At this point I would also be willing to change to another logging solution if it is known to work correctly with MVC. </p>
  
  <p>Thanks
  Tim</p>