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:

 log4net:
 log4net:WARN
 log4net:ERROR 

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:

http://tinyurl.com/a5l9n
http://www.mail-archive.com/log4net-user%40logging.apache.org/msg01698.html

--- 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 
> 
> 


Mime
View raw message