Gary,

Would you mind creating a Jira ticket for this? With the volume of email on the 
list it drops off the horizon very quickly otherwise...

Remko


________________________________
 From: Gary Gregory <[email protected]>
To: Log4J Developers List <[email protected]> 
Sent: Sunday, July 7, 2013 3:32 PM
Subject: Console appender with and without ANSI output
 


Hi All,

I'm seeing something odd in trunk:

When I run 
org.apache.logging.log4j.core.appender.ConsoleAppenderAnsiStyleLayoutMain

I see double stack traces:

[30m2013-07-07 02:27:09,904[m [34m[main][m [33mFATAL:[m [32mFatal message.
[m[30m2013-07-07 02:27:09,906[m [34m[main][m [33mERROR:[m [32mError message.
[m[30m2013-07-07 02:27:09,907[m [34m[main][m [33mWARN :[m [32mWarning message.
[m[30m2013-07-07 02:27:09,907[m [34m[main][m [33mINFO :[m [32mInformation 
message.
[m[30m2013-07-07 02:27:09,907[m [34m[main][m [33mDEBUG:[m [32mDebug message.
[m[30m2013-07-07 02:27:09,907[m [34m[main][m [33mTRACE:[m [32mTrace message.
[m[30m2013-07-07 02:27:09,907[m [34m[main][m [33mERROR:[m [32mError message.
java.io.IOException: test
    at 
org.apache.logging.log4j.core.appender.ConsoleAppenderAnsiStyleLayoutMain.main(ConsoleAppenderAnsiStyleLayoutMain.java:44)
[m java.io.IOException: test
    at 
org.apache.logging.log4j.core.appender.ConsoleAppenderAnsiStyleLayoutMain.main(ConsoleAppenderAnsiStyleLayoutMain.java:44)
 [test-classes/:?]

Note that the last one includes jar provenance.

The patter in /log4j-core/src/test/resources/log4j2-console-style-ansi.xml is:

%style{%d{ISO8601}}{black} %style{[%t]}{blue} %style{%-5level:}{yellow} 
%style{%msg%n%throwable}{green}

When I switch the test to use 


/log4j-core/src/test/resources/log4j2-console.xml, the output contains a single 
track trace without jar provenance. The patter there is:

%d{ISO8601} [%t] %-5level: %msg%n%throwable


Looks like a bug in pattern/layout parsing?


Gary




-- 

E-Mail: [email protected] | [email protected] 
Java Persistence with Hibernate, Second Edition
JUnit in Action, Second Edition
Spring Batch in Action
Blog: http://garygregory.wordpress.com 
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Reply via email to