-
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
Emulate effects of j.u.l.Logger.setLevel
#3125
Conversation
Some libraries rely on `j.u.l.Logger.getLevel` returning the value that was set using `j.u.l.Logger.setLevel`. This PR changes #2353 so that: - By default, the **effective** configuration of the logging backend is not modified by `log4j-jul`. - Calling `setLevel` modifies the return value of `getLevel`. Both these methods should **not** be used in user code, because the **effective** level of a logger should be checked with `j.u.l.isLoggable` instead. Therefore, I don't see any potential problems with these modifications. Closes #3119
Anticipating other similar problems with the The |
Can you check if the latest |
@ppkarwasz appreciated it, unfortunately we rely on the Velocity software which uses said library, I found out the problem started since of this commit: PaperMC/Velocity@f2d6e14 I do not see them using log4j2, my question is can I do something on my end? I am essentially developing a plugin for velocity which can add libraries to Velocity classpath, so I think I have some options on my end too. Thanks! |
@ppkarwasz could you please provide nashorn-core snapshot, instead? Because production is affected since October, I could just use the snapshot for now. Many thanks. |
I am not a Nashorn maintainer, sorry. PaperMC does use |
Gotcha, thanks for the that, I have passed them the relevant information. I am unfortunately not a Paper maintainer either. |
The workaround for this bug was provided by the reporter in this comment:
You can de facto apply that right now on prod. |
@ppkarwasz Thank you, you made my day with this fix!!! I will add a note to our customers so that they can adjust their server system properties for now. |
Some libraries rely on
j.u.l.Logger.getLevel
returning the value that was set usingj.u.l.Logger.setLevel
.This PR changes #2353 so that:
log4j-jul
.setLevel
modifies the return value ofgetLevel
. Both these methods should not be used in user code, because the effective level of a logger should be checked withj.u.l.isLoggable
instead. Therefore, I don't see any potential problems with these modifications.Closes #3119