You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Graham Walsh <gr...@calyon.com> on 2008/06/18 10:14:38 UTC

Winforms

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

 


RE: Winforms

Posted by Graham Walsh <gr...@calyon.com>.
Im in awe of this stuff. Would have taken me weeks to get all this done
with c++. 

 

 

________________________________

From: Rob Prouse [mailto:Rob.Prouse@Ivara.com] 
Sent: Friday, June 20, 2008 2:28 PM
To: Log4NET User
Subject: RE: Winforms

 

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

 

From: Graham Walsh [mailto:graham.walsh-prestataire@calyon.com] 
Sent: June-20-08 7:43 AM
To: Log4NET User
Subject: RE: Winforms

 

Its ok I sorted it out. Dunno what 

 

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

 

Does exactly but commented out everything works as expected 

 

G

 

 

________________________________

From: WALSH, Graham (CALYON) 
Sent: Friday, June 20, 2008 12:22 PM
To: Log4NET User
Subject: RE: Winforms

 

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

 

________________________________

From: WALSH, Graham (CALYON) 
Sent: Wednesday, June 18, 2008 6:45 PM
To: 'Log4NET User'
Subject: RE: Winforms

 

Thanks dude, I think I got it...

 

 

Stephanie Giovannini <gi...@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 :-) 

 

G

 

________________________________

From: Rob Prouse [mailto:Rob.Prouse@Ivara.com] 
Sent: Wednesday, June 18, 2008 5:51 PM
To: Log4NET User
Subject: RE: Winforms

 

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

 

From: Graham Walsh [mailto:graham.walsh-prestataire@calyon.com] 
Sent: June-18-08 4:15 AM
To: Log4NET User
Subject: Winforms

 

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

 


RE: Winforms

Posted by Rob Prouse <Ro...@Ivara.com>.
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

From: Graham Walsh [mailto:graham.walsh-prestataire@calyon.com]
Sent: June-20-08 7:43 AM
To: Log4NET User
Subject: RE: Winforms

Its ok I sorted it out. Dunno what

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

Does exactly but commented out everything works as expected

G


________________________________
From: WALSH, Graham (CALYON)
Sent: Friday, June 20, 2008 12:22 PM
To: Log4NET User
Subject: RE: Winforms

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

________________________________
From: WALSH, Graham (CALYON)
Sent: Wednesday, June 18, 2008 6:45 PM
To: 'Log4NET User'
Subject: RE: Winforms

Thanks dude, I think I got it...


Stephanie Giovannini <gi...@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 :)

G

________________________________
From: Rob Prouse [mailto:Rob.Prouse@Ivara.com]
Sent: Wednesday, June 18, 2008 5:51 PM
To: Log4NET User
Subject: RE: Winforms

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

From: Graham Walsh [mailto:graham.walsh-prestataire@calyon.com]
Sent: June-18-08 4:15 AM
To: Log4NET User
Subject: Winforms

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


RE: Winforms

Posted by Graham Walsh <gr...@calyon.com>.
Its ok I sorted it out. Dunno what 

 

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

 

Does exactly but commented out everything works as expected 

 

G

 

 

________________________________

From: WALSH, Graham (CALYON) 
Sent: Friday, June 20, 2008 12:22 PM
To: Log4NET User
Subject: RE: Winforms

 

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

 

________________________________

From: WALSH, Graham (CALYON) 
Sent: Wednesday, June 18, 2008 6:45 PM
To: 'Log4NET User'
Subject: RE: Winforms

 

Thanks dude, I think I got it...

 

 

Stephanie Giovannini <gi...@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 :-) 

 

G

 

________________________________

From: Rob Prouse [mailto:Rob.Prouse@Ivara.com] 
Sent: Wednesday, June 18, 2008 5:51 PM
To: Log4NET User
Subject: RE: Winforms

 

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

 

From: Graham Walsh [mailto:graham.walsh-prestataire@calyon.com] 
Sent: June-18-08 4:15 AM
To: Log4NET User
Subject: Winforms

 

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

 


RE: Winforms

Posted by Graham Walsh <gr...@calyon.com>.
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

 

________________________________

From: WALSH, Graham (CALYON) 
Sent: Wednesday, June 18, 2008 6:45 PM
To: 'Log4NET User'
Subject: RE: Winforms

 

Thanks dude, I think I got it...

 

 

Stephanie Giovannini <gi...@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 :-) 

 

G

 

________________________________

From: Rob Prouse [mailto:Rob.Prouse@Ivara.com] 
Sent: Wednesday, June 18, 2008 5:51 PM
To: Log4NET User
Subject: RE: Winforms

 

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

 

From: Graham Walsh [mailto:graham.walsh-prestataire@calyon.com] 
Sent: June-18-08 4:15 AM
To: Log4NET User
Subject: Winforms

 

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

 


RE: Winforms

Posted by Graham Walsh <gr...@calyon.com>.
Thanks dude, I think I got it...

 

 

Stephanie Giovannini <gi...@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 :-) 

 

G

 

________________________________

From: Rob Prouse [mailto:Rob.Prouse@Ivara.com] 
Sent: Wednesday, June 18, 2008 5:51 PM
To: Log4NET User
Subject: RE: Winforms

 

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

 

From: Graham Walsh [mailto:graham.walsh-prestataire@calyon.com] 
Sent: June-18-08 4:15 AM
To: Log4NET User
Subject: Winforms

 

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

 


RE: Winforms

Posted by Rob Prouse <Ro...@Ivara.com>.
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

From: Graham Walsh [mailto:graham.walsh-prestataire@calyon.com]
Sent: June-18-08 4:15 AM
To: Log4NET User
Subject: Winforms

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