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

-----Original Message-----
From: scarleton@gmail.com [mailto:scarleton@gmail.com] On Behalf Of Sam
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:


    <!-- Define some output appenders -->
    <appender name="RollingLogFileAppender"
      <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" />

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

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

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

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

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


View raw message