logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dean Fiala" <dfi...@celadonlabs.com>
Subject RE: OutputDebugStringAppender w/ VS2005
Date Fri, 09 Jun 2006 19:19:20 GMT
This is a little bit of goofiness that is documented somewhere.  You'll find
that the 
log4net.Appender.TraceAppender
Will do what you want.  This is what I use....

     <!-- to show in Debug output use trace instead -->
    <appender name="Debugger" type="log4net.Appender.TraceAppender">
        <layout type="log4net.Layout.SimpleLayout" />
    </appender>
     

-----Original Message-----
From: scarleton@gmail.com [mailto:scarleton@gmail.com] On Behalf Of Sam
Carleton
Sent: Friday, June 09, 2006 2:31 PM
To: log4net-user@logging.apache.org
Subject: OutputDebugStringAppender w/ VS2005

I am writing a windows EXE application and trying to use the
OutputDebugStringAppender to get a dump in the output window of VS2005 with
no luck.  Here is the app.config:

-------------------------
  <log4net>

    <!-- Define some output appenders -->
    <appender name="RollingLogFileAppender"
type="log4net.Appender.RollingFileAppender">
      <file value="TOCEngine.Rolling.txt" />
      <appendToFile value="true" />
      <maxSizeRollBackups value="10" />
      <maximumFileSize value="1MB" />
      <rollingStyle value="Once" />
      <staticLogFileName value="true" />
      <layout type="log4net.Layout.PatternLayout">
        <header value="[Header]&#13;&#10;" />
        <footer value="[Footer]&#13;&#10;" />
        <conversionPattern value="%date [%thread] %-5level %logger [%ndc] -
%message%newline" />
      </layout>
    </appender>

    <appender name="ConsoleAppender"
type="log4net.Appender.ConsoleAppender">
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date %message%newline" />
      </layout>
    </appender>

    <appender name="DebugConsoleOutput"
type="log4net.Appender.OutputDebugStringAppender">
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date %message%newline" />
      </layout>
    </appender>

    <!-- Setup the root category, add the appenders and set the default
level -->
    <root>
      <level value="DEBUG" />
      <appender-ref ref="DebugConsoleOutput" />
      <appender-ref ref="RollingLogFileAppender" />
    </root>

    <!-- Specify the level for some specific categories -->
    <logger name="Nano.TOCEngine.Program">
      <level value="ALL" />
      <appender-ref ref="ConsoleAppender" />
    </logger>
  </log4net>
-------------------------

Any thoughts on how I get it to log to the VS2005 window?

Sam




Mime
View raw message