Discussion:
[Bug 56915] New: PatternLayout - %c in ConversionPattern is not returning what is expected.
b***@apache.org
2014-09-04 22:59:27 UTC
Permalink
https://issues.apache.org/bugzilla/show_bug.cgi?id=56915

Bug ID: 56915
Summary: PatternLayout - %c in ConversionPattern is not
returning what is expected.
Product: Log4j
Version: 1.2.17
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: Layout
Assignee: log4j-***@logging.apache.org
Reporter: ***@gmail.com

Using this pattern:
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L -
%m%n" />

==> result

2014-09-04 15:42:51 DEBUG headers:116 - http-outgoing-1 << Connection:
Keep-Alive
2014-09-04 15:42:51 DEBUG headers:116 - http-outgoing-1 << Content-Type:
application/json; charset=utf-8


Just for comparison, I ran the same code with the following pattern (replacing
%c{1} with %C:
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5p %C:%L -
%m%n" />

==> result

2014-09-04 15:45:12 DEBUG
org.apache.http.impl.conn.LoggingManagedHttpClientConnection:116 -
http-outgoing-2 << Connection: Keep-Alive
2014-09-04 15:45:12 DEBUG
org.apache.http.impl.conn.LoggingManagedHttpClientConnection:116 -
http-outgoing-2 << Content-Type: application/json; charset=utf-8

"%c{1}" is not getting the right-most component as described in the
documentation.

Please let me know if you need more info, or I'm doing something wrong!
Thanks,
Kumi
--
You are receiving this mail because:
You are the assignee for the bug.
Loading...