logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Goyal, Nitin UTAS" <Nitin.Go...@utas.utc.com>
Subject RE: [External] Programmatically add newline to header & footer
Date Fri, 31 Oct 2014 00:42:42 GMT
You have to call activateoptions when you change or update header or conversion pattern.

I am doing the same way ansand able to add newline.


________________________________________
From: Andre Cassar [shevino@gmail.com]
Sent: Friday, October 31, 2014 02:31 AM
To: log4net-user@logging.apache.org
Subject: [External] Programmatically add newline to header & footer

Hi guys,

I'm configuring log4net programmatically and not using the xml configuration. I want to be
able to add a newline to the header and footer. How can you do that? I tried %newline, \r,\n,
&#13;&#10; but all in vain.

My code looks like this:

PatternLayout patternLayout = new PatternLayout();
            patternLayout.ConversionPattern = "%date [%thread] %-5level %logger : %message%newline";
            patternLayout.Header = "%newline****** [Logging Started] ******%n[Date] [Thread
ID] [Level] [Logger] : [Log Entry]&#13;&#10;";
            patternLayout.Footer = "****** [Logging Stoped] ******&#13;&#10;";

Any ideas please?


Thanks beforehand
Andre Cassar

Mime
View raw message