logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Radovan Raszka <ras...@hasam.cz>
Subject RE: New to log4net. Easy question?
Date Mon, 17 Sep 2012 07:17:14 GMT
Hello,
It is good idea to add %newline at the end of message pattern, otherwise two messages are
mixed on single line
Radovan 

-----Původní zpráva-----
Od: SEGERS Steven (CNH) [mailto:steven.segers@cnh.com] 
Odesláno: 16. září 2012 8:11
Komu: Log4NET User
Předmět: RE: New to log4net. Easy question?

Because you have a space in front of %exception.

Best regards

Steven

-----Original Message-----
From: DaneVinson [mailto:dane.vinson@gmail.com] 
Sent: zondag 16 september 2012 6:48
To: log4net-user@logging.apache.org
Subject: New to log4net. Easy question?


/* Code */
protected static readonly ILog Logger =
log4net.LogManager.GetLogger(typeof(Program));
static void Main(string[] args)
{
    Logger.Info("Test line");
    Logger.Info("Test line 2");
    Logger.Info("Test line 3");

/* Appender */
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%date{ABSOLUTE} - %-5level - %message%newline %exception"/>
  </layout>
</appender>

/* Output */
21:40:26,429 - INFO  - Test line
 21:40:26,441 - INFO  - Test line 2
 21:40:26,441 - INFO  - Test line 3

Why the leading single space on every entry after the first?
--
View this message in context: http://old.nabble.com/New-to-log4net.-Easy-question--tp34438289p34438289.html
Sent from the Log4net - Users mailing list archive at Nabble.com.


Mime
View raw message