log4Net EventlogAppender does not work for Asp.Net 2.0 WebSite?

Posted by Amitabh on Stack Overflow See other posts from Stack Overflow or by Amitabh
Published on 2010-04-06T18:53:26Z Indexed on 2010/04/06 19:03 UTC
Read the original article Hit count: 615

I have configured log4Net EventLogAppender for Asp.Net 2.0. However it does not log anything. I have following in my Web.Config.

<log4net>
    <appender name="EventLogAppender" type="log4net.Appender.EventLogAppender">
      <param name="LogName" value="Test Log" />
      <param name="ApplicationName" value="Test-Web" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
      </layout>
    </appender>
    <root>
      <priority value="ERROR"/>
      <appender-ref ref="EventLogAppender"/>
    </root>
    <logger name="NHibernate">
      <level value="ERROR" />
      <appender-ref ref="EventLogAppender" />
    </logger>
  </log4net>

I already have Test-Log Event Log created and AspNet user has permission on the Event Log registry entry. I also have log4Net configured in Global.asax Application_Start.

log4net.Config.XmlConfigurator.Configure();

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about 2.0