logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From talktopete <talktop...@gmail.com>
Subject Trying to set up an EXTREMELY SIMPLE event log feature... and failing terribly! Please help a newbie
Date Tue, 11 Nov 2008 21:34:20 GMT

Hi and thanks in advance for the help.
I'm tearing my hair out over here trying to get this to work: a siple logger
that writes to the application section of the event log.

This is using log4net 1.2.10.0
Here is the app config:
--------------------------------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
  </configSections>

  <log4net>
    <appender name="EventLogAppender"
type="log4net.Appender.EventLogAppender" >
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger
[%property{NDC}] - %message%newline" />
      </layout>
    </appender>
    <root>
      <level value="ALL" />
      <appender-ref ref="EventLogAppender" />
    </root>
  </log4net>
</configuration>
--------------------------------------------------------------------
here is my code:
  log4net.Config.XmlConfigurator.Configure();
  logger = LogManager.GetLogger("EventLogAppender");
  logger.Error("test");
-------------------------------------------------------------------

No errors, nothing happens! I notice that there are no appenders.
nothing is written to the event log.

I am tearing my hair out trying to figure out what is going on, can somebody
help?
-- 
View this message in context: http://www.nabble.com/Trying-to-set-up-an--EXTREMELY-SIMPLE-event-log-feature...-and-failing-terribly%21-Please-help-a-newbie-tp20448428p20448428.html
Sent from the Log4net - Users mailing list archive at Nabble.com.


Mime
View raw message