logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicko Cadell" <ni...@neoworks.com>
Subject RE: Finding out whether a specific appender is attached
Date Wed, 08 Dec 2004 15:07:37 GMT

> Now, on my development system, I like to set up log4net to 
> use a TraceAppender so that I can easily see the log4net 
> output in Visual Studio when debugging. Of course, I can't 
> use my own TraceListener and the log4net TraceAppender at the 
> same time. So I'd like to find out (during initialization of 
> my app) whether a TraceAppender is in the root category of 
> the current log4net configuration and only set up my 
> TraceListener if there's no TraceAppender.

You may be able to use the OutputDebugStringAppender. This appender uses
the OutputDebugString API. The VisualStudio Debugger catches this output
and displays it in the Debug Output window. This only works for
applications that the debugger launches rather than ones is attaches to,
therefore it won't work for ASP.NET applications.


Nicko Cadell
log4net development

View raw message