SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

log4net ConsoleAppender output

Last post 01-16-2008 3:21 PM by cristiroma. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-05-2006 2:08 PM

    log4net ConsoleAppender output

    Hi All,

     I am using log4net in my application but SharpDevelop is not showing the output for my ConsoleAppender when I run the app. In MS Visual studio the output for the ConsoleAppender shows up in the Output window.

     Does anyone have any suggestions?

     
    Thanks,

    Serge

     

  • 01-16-2008 10:00 AM In reply to

    Re: log4net ConsoleAppender output

     I have the same problem, have you successfully fixed this?

    Otherwise log4net is working fine, logging into the FileAppender 

  • 01-16-2008 12:05 PM In reply to

    Re: log4net ConsoleAppender output

    The Output window in SharpDevelop only shows the output of compilers and other tools, not of the running app. Set your app to compile as Console Application to give it it's own console window; or use a log4net appender that writes to System.Diagnostics.Debug.WriteLine if you want the log to appear in SharpDevelop's output window.

  • 01-16-2008 3:21 PM In reply to

    Re: log4net ConsoleAppender output

    Cool, that worked.

    For the poor soul, add the following to App.config:

     ...

        <appender name="TraceAppender" type="log4net.Appender.TraceAppender">
          <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%-5level %logger - %message%newline" />
          </layout>
        </appender>
     

    ...
        <system.diagnostics>
          <trace autoflush="false" indentsize="3" />
        </system.diagnostics>  

     

    ...

      <root>
          <level value="DEBUG" />

            ... 

          <appender-ref ref="TraceAppender" />
        </root>

Page 1 of 1 (4 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.