Friday, May 18, 2012
 
The best way to analyze your logs! Minimize
 Log4Net Mail archive   

The Log4Net mailing list is a great source of information about using log4Net, in this forum we collect all the messages in the log4net user list and some selected threads from the developer list.

Subject: Winforms
Prev Next
You are not authorized to post a reply.

Author Messages
Graham Walsh

06/18/2008 10:14 AM  

Hi,

 

Could anybody tell me where is the best starting point to integrate log4net into a winforms application ?  I intend to have a UPD appender configured and have my log information displayed in a textbox. Is a textbox the best control to go with? How do I attach my log output to the control I ultimately decide upon?

 

 

Thanks for any info/replies. Have a nice day

 

Graham

 

Rob Prouse

06/18/2008 5:51 PM  

Graham,

 

If you check back in the archives for this list about a month, someone posted an appender that writes to a RichTextBox. I used it and it works well. It allows you to colourize your output which is nice for the different log levels.

 

If you can’t find it, let me know and I will repost.

 

Rob Prouse

 

Graham Walsh

06/18/2008 6:45 PM  

Thanks dude, I think I got it…

 

 

Stephanie Giovannini <giovannini-s....@swbell.net>

Subject Rich text box appender

Date Thu, 24 Apr 2008 16:12:24 GMT

 

 

 

That’ll be my reading on my way home the lousy sweaty French metro system J

 

G

 

Graham Walsh

06/20/2008 12:21 PM  

Hi again,

 

That utility works a treat. Thanks a million Rob and Stephanie!

 

I have just two minor points (cosmetic).

 

1)       I have my log output in the rich text box (whose background colour is grey). My log output appears but its not in colour. I know its not essential, but it adds to user satisfaction to see errors in red. Any ideas why this is this case? Am I badly configured?

 

This is what my configuration section looks like;

 

 

 

  <appender name="MainFormRichTextAppender" type="log4net.Appender.RichTextBoxAppender">

    <file value="logs/RichTextAppenderRocks.log" />

    <appendToFile value="true" />

    <maximumFileSize value="25000KB" />

    <maxSizeRollBackups value="2" />

    <layout type="log4net.Layout.PatternLayout">

      <conversionPattern value="%date [%-2thread] %-5level %-70logger - %message%newline" />

    </layout>

    <code lang="XML" escaped="true">

      <mapping>

        <level value="DEBUG" />

        <textColorName value="DarkGreen" />

 

      </mapping>

      <mapping>

        <level value="INFO" />

        <textColorName value="ControlText" />

 

      </mapping>

      <mapping>

        <level value="WARN" />

        <textColorName value="Blue" />

 

      </mapping>

      <mapping>

        <level value="ERROR" />

        <textColorName value="Red" />

        <bold value="true" />

        <pointSize value="10" />

 

      </mapping>

      <mapping>

        <level value="FATAL" />

        <textColorName value="Black" />

        <backColorName value="Red" />

        <bold value="true" />

        <pointSize value="12" />

        <fontFamilyName value="Lucida Console" />

 

      </mapping>

    </code>

    </appender>

 

 

 

Thanks a million. This stuff rocks

 

G

 

Graham Walsh

06/20/2008 1:43 PM  

Its ok I sorted it out. Dunno what

 

    <code lang="XML" escaped="true">

 

Does exactly but commented out everything works as expected

 

G

 

Rob Prouse

06/20/2008 2:28 PM  

That is just a confusing artefact of Microsoft’s code commenting. That is part of the comment like /// <summary> that indicates a code example follows. It is not part of the configuration.

 

Rob

 

Graham Walsh

06/20/2008 2:35 PM  

Im in awe of this stuff. Would have taken me weeks to get all this done with c++.

You are not authorized to post a reply.



ActiveForums 3.7

 

 

 

 

 

 

 

 

Log4Net Dashboard

Log analysis and monitoring made easy!

Log4Net Dashboard is a log viewer that can read log statements from a variety of logging output targets.

You can download a free developer version.

  

Check it out!

On the demonstration site you can try it  with live data.demo.l4ndash.com - Try Log4Net Dashboard with live data

The mail archive is a copy of all the mail sent to the mail address: log4net-user@logging.apache.org, organized as a forum.

If you would like to participate in the mail list, send a mail to log4net-user-subscribe@logging.apache.org.

More information about the mailing list is available on: http://logging.apache.org/log4net/support.html

 

A complete topic list is available and can be viewed here (warning, it takes some time to load)

 

Copyright 2005-2008 by FaktNet AS Terms Of Use Privacy Statement