logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 10706] - MDC layout format %X{...} enhancement
Date Fri, 19 Sep 2003 12:16:07 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10706>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10706

MDC layout format %X{...} enhancement





------- Additional Comments From ssegers@kiala.com  2003-09-19 12:16 -------
I just ran into this as well. What has not been reported is that a
NullPointerException is thrown when you put %X in the pattern:

Exception in thread "main" java.lang.NullPointerException
        at java.util.Hashtable.get(Hashtable.java:329)
        at org.apache.log4j.MDC.get0(MDC.java:121)
        at org.apache.log4j.MDC.get(MDC.java:75)
        at org.apache.log4j.spi.LoggingEvent.getMDC(LoggingEvent.java:221)
        at
org.apache.log4j.helpers.PatternParser$MDCPatternConverter.convert(PatternParser.java:455)
        at
org.apache.log4j.helpers.PatternConverter.format(PatternConverter.java:56)
        at org.apache.log4j.PatternLayout.format(PatternLayout.java:495)
        at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:297)
        at org.apache.log4j.WriterAppender.append(WriterAppender.java:150)
        at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:222)
        at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:57)
        at org.apache.log4j.Category.callAppenders(Category.java:190)
        at org.apache.log4j.Category.forcedLog(Category.java:375)
        at org.apache.log4j.Category.info(Category.java:678)
        at com.kiala.common.Test.main(Test.java:32)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org


Mime
View raw message