logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Console appender with and without ANSI output
Date Sun, 07 Jul 2013 06:32:12 GMT
Hi All,

I'm seeing something odd in trunk:

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

I see double stack traces:

2013-07-07 02:27:09,904 [main] FATAL: Fatal
message.
2013-07-07 02:27:09,906 [main] ERROR: Error
message.
2013-07-07 02:27:09,907 [main] WARN :
Warning message.
2013-07-07 02:27:09,907 [main] INFO :
Information message.
2013-07-07 02:27:09,907 [main] DEBUG: Debug
message.
2013-07-07 02:27:09,907 [main] TRACE: Trace
message.
2013-07-07 02:27:09,907 [main] ERROR: Error
message.
java.io.IOException: test
    at
org.apache.logging.log4j.core.appender.ConsoleAppenderAnsiStyleLayoutMain.main(ConsoleAppenderAnsiStyleLayoutMain.java:44)
 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: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Mime
View raw message