Do you mean errors that your application is logging using log4net, or do
you mean internal errors within the log4net framework?

To log application logged errors to the event log you need to configure
an EventLogAppender and wire this up to the root logger:

<appender name="EventLogAppender"
type="log4net.Appender.EventLogAppender" >
  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%date [%thread] %-5level %logger -
%message%newline" />
  </layout>
</appender>

<root>
  <level value="ERROR" />
  <appender-ref ref="EventLogAppender" />
</root>

If you want to capture internal log4net framework errors then that is
rather more challenging. You can't centrally hook into the internal
LogLog class, however you can configure a custom IErrorHandler for each
appender. If you need to do this can you reply with details of which
internal errors you are trying to capture.

Cheers,

Nicko

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: 06 June 2005 13:03
> To: log4net-user@logging.apache.org
> Subject: logging log4net exceptions to event log
> 
> 
> Hi, 
> 
> I am using log4net 1.2.9 from a web application as well as 
> class library (.Net framework 1.1). If there are any errors 
> within log4net, I want them to be logged to eventlog. 
> However, I dont want to log the Debug calls unless I need 
> them. Can I configure the level of logging for internal 
> log4net log calls?
> 

Reply via email to