-
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
Exception thrown in class annotated with @Plugin that uses a logger #3240
Comments
Thanks for reporting it. Log4j loads all annotated implementations of There is a special logger (see Status Logger) that you can use in Log4j Plugins, but you should not use loggers obtained from |
Hey @ppkarwasz , thanks for the quick reply. I tested and using a |
The problem you are encountering is due to the
These are the main reasons we moved the initialization of the default message factory at a later stage. Note: we can easily fix the initialization problem, by moving
|
Description
Trying to use a logger in a class annotated with
@Plugin
fromorg.apache.logging.log4j.core.config.plugins
throws an exception. The same problem does not happen on versions 2.23.1, 2.24.0 and 2.24.1.Configuration
Version: 2.24.2
Operating system: linux
JDK: Amazon Correto, 21
Logs
Reproduction
The code below used to run fine, then after upgrading to 2.24.2 it started throwing on application startup. Getting rid of the
LOGGER
variable "fixes" the problem.The text was updated successfully, but these errors were encountered: