logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: logging log4net exceptions to event log
Date Thu, 09 Jun 2005 12:58:13 GMT
You could write your own EventLogTraceListener
(System.Diagnostics.EventLogTraceListener is sealed) that looks for
trace messages beginning with the following prefixes:


And logs those messages to the Event Log accordingly. Here is an
example that shows how to redirect all of log4net's internal debug
messages to a file using a TraceListener:


--- hbmlists@softhome.net wrote:

> Thanks for the reply Nicko. First I would clarify that I meant
> internal 
> errors within log4net framework. My requirement is that if there is
> any 
> internal error within log4net then that should be logged to event
> log. 
> I am aware of the log4net.internal.debug setting but that logs not
> only 
> errors but other Debug level messages as well. When my application is
> in 
> production, I would like to configure log4net to log only internal
> errors 
> and not other internal Debug messages.When I need to diagnose a
> log4net 
> problem I would like to increase the level of logging from "Error" to
> "Debug". So can I configure the level of logging for log calls within
> log4net? 
> Thanks,
> Hemant 

View raw message