Bug 47912 - Jul to log4j bridge Crash.
Summary: Jul to log4j bridge Crash.
Status: RESOLVED FIXED
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-28 06:41 UTC by Adrian Stanila
Modified: 2009-10-03 15:33 UTC (History)
0 users



Attachments
return of getLoggerName validation (2.32 KB, patch)
2009-09-28 06:41 UTC, Adrian Stanila
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Stanila 2009-09-28 06:41:13 UTC
Created attachment 24321 [details]
return of getLoggerName validation

getLoggerName() function from java.util.logging.LogRecord it can return Null as
specified in documentation:
http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/LogRecord.html#getLoggerName%28%29

return of getLoggerName is not verified in JULLog4jEventConverter.java and
JULBridgeHandler.java

Patch attached.

Regards
Comment 1 Adrian Stanila 2009-09-28 10:20:33 UTC
It's generating the following exception:

java.lang.NullPointerException
        at org.apache.log4j.CategoryKey.<init>(CategoryKey.java:32)
        at org.apache.log4j.Hierarchy.getLogger(Hierarchy.java:266)
        at org.apache.log4j.Hierarchy.getLogger(Hierarchy.java:247)
        at org.apache.logging.julbridge.JULLog4jEventConverter.convert(JULLog4jEventConverter.java:121)
        at org.apache.logging.julbridge.JULBridgeHandler.publish(JULBridgeHandler.java:49)
        at java.util.logging.Logger.log(Logger.java:458)
        at java.util.logging.Logger.doLog(Logger.java:480)
        at java.util.logging.Logger.log(Logger.java:503)
Comment 2 Scott Deboy 2009-10-03 15:33:04 UTC
Patch applied to svn trunk in r821436.

Thanks Adrian