-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPE when using rootLogger
shorthand properties notation
#3206
Comments
Does the problem also occur with version |
@ppkarwasz
|
rootLogger
shorthand properties notation
@ppkarwasz could u please elaborate the issue if u got that? |
There is problem in your configuration: you both use the shorthand rootLogger.level = INFO
rootLogger.appenderRef.0.ref = console or the shorthand notation (which only exists in the Java properties format): rootLogger = INFO, console The NPE is due to the fact that the current code does not handle the case, when the shorthand notation is used and no appender reference is provided ( |
Thanks @ppkarwasz |
This bug only affects very unlikely configuration scenario, when a user does not want any appenders for the root logger. It is not a priority. Your configuration triggered the bug, because you have a typo in your configuration: replace |
thanks @ppkarwasz |
I keep this open, so we can fix the NPE in the rare case a user really does not want any appenders attached to the root logger. |
Currently we are using log4j2 version 2.17.0 with spring boot but while updating log4j2 to 2.17.2 we are getting below error and which is because of the appender of root is initialise to null
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because the return value of "org.apache.logging.log4j.core.config.LoggerConfig.getAppenderRefs()" is null
We are passing below properties:
Please help us to understand if we require some changes along with version upgrade?
The text was updated successfully, but these errors were encountered: