You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2022/08/22 21:07:00 UTC

[jira] [Commented] (LOG4J2-3564) NPE in JULLogger.getLevel()

    [ https://issues.apache.org/jira/browse/LOG4J2-3564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17583202#comment-17583202 ] 

ASF subversion and git services commented on LOG4J2-3564:
---------------------------------------------------------

Commit 3df5ce9b1ab17c4c7f0cdd1caef18db959fef937 in logging-log4j2's branch refs/heads/slf4j-2.0 from Piotr P. Karwasz
[ https://gitbox.apache.org/repos/asf?p=logging-log4j2.git;h=3df5ce9b1a ]

[LOG4J2-3564] Fix NPE when root logger level is null

`LogManager.getGlobal().getLevel()` is not a good fallback for the case
when all JUL logger levels are null, since its level is usually null.

> NPE in JULLogger.getLevel()
> ---------------------------
>
>                 Key: LOG4J2-3564
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3564
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Log4j-to-JUL
>    Affects Versions: 2.17.2
>            Reporter: Piotr Karwasz
>            Priority: Minor
>
> {{JULLogger.getLevel()}} fails with a {{NullPointerException}} if the JUL root logger has a {{null}} level. This is a common situation in JDK 8+, since {{LogManager$RootLogger}} does not set the log level any more in its constructor.
> A practical example where it fails is Tomcat's {{ClassLoaderLogManager}}: cf. [BZ 66184|https://bz.apache.org/bugzilla/show_bug.cgi?id=66184].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)