-
Notifications
You must be signed in to change notification settings - Fork 41k
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
Actuator loggers list endpoint throws exception on Log4J2 loggers with custom log levels #35227
Comments
Thanks for the report. I wasn't aware that Log4j2 supported custom log levels. As you have noticed, the problem isn't specific to the actuator endpoint. Setting We can consider adding support for custom log levels but it looks like it would be quite invasive and require changes to public API. As such, I'm afraid it's unlikely to happen soon. We could also consider just tolerating levels that we don't recognise, either by dropping them or by performing an approximate mapping. I'm not sure that either would be useful in practice though. |
I think its acceptable to lose some framework features by using custom log levels, but completely losing |
This also affects Java Util Logging as it too supports custom levels. |
@miladamery Out of interest, how do you define your custom log levels? I assume you use |
@philwebb yeah, you can create your custom log level with that method, we can pass that variable to
|
We'd like to update 2.7.x to tolerate custom log levels in the actuator endpoint. Whether or not that's possible will depend on the scope of the fix and the need for public API changes. |
We are using Log4j as our logging framework. One of our loggers has custom Log level. When calling actuator /loggers endpoint to get list of all loggers exception raises:
EffectiveLevel must not be null
This error is from
LoggerConfiguration
class constructor which doesnt letnull
values oneffectiveLevel
variable:but the real problem comes when calling this class constructor. in
Log4J2LoggingSystem
.convertLoggerConfig
:The LEVELS variable:
is like above. Our custom log level doesn't exist in this Map. so this line returns null
and we get the exception.
The text was updated successfully, but these errors were encountered: