Description
The Logger cache does not account for a logger's message factory.
If you call LogManager.getLogger(Class|Object|String, MessageFactory) and then call a getLogger() API again with the same Class|Object|String a different message factory, you get the Logger that was first created which means you will not get the proper formatted messages.
For example:
Logger loggerA1 = LogManager.getLogger("A", messageFactory1); Logger loggerA2 = LogManager.getLogger("A", messageFactory2);
loggerA1 is the same as loggerA2.
This is a problem if two unrelated code bases (jars) both the same Logger names|objects|classes.
Attachments
Attachments
Issue Links
- is related to
-
LOG4J2-1407 Misleading WARN log events from Log4j about message factories and unexpected formatting
- Closed
- is superceded by
-
LOG4J2-1404 log4j-slf4j-impl 2.6 is warning
- Closed