logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sam Carleton" <scarle...@miltonstreet.com>
Subject OutputDebugStringAppender w/ VS2005
Date Fri, 09 Jun 2006 18:30:43 GMT
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