[
https://issues.apache.org/jira/browse/LOG4J2-1180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15310369#comment-15310369
]
Greg Huber edited comment on LOG4J2-1180 at 6/1/16 2:17 PM:
------------------------------------------------------------
Hello,
Since upgrading to 2.6 (from 2.5), I am now getting this message in the console
(tomcat):
MyClass was created with the message factory
org.apache.logging.log4j.spi.MessageFactory2Adapter@796e8a0f and is now
requested with a null message factory (defaults to
org.apache.logging.log4j.message.ParameterizedMessageFactory), which may create
log events with unexpected formatting.
I am using org.apache.commons.logging.LogFactory bridge with these jars
log4j-1.2-api-2.5.jar
log4j-api-2.5.jar
log4j-core-2.5.jar
log4j-jcl-2.5.jar
log4j-slf4j-impl-2.5.jar
Not sure if it relates to this patch, but if it does any ideas how to resolve
the message?
Cheers
was (Author: gregh99):
Hello,
Since upgrading to 2.6 (from 2.5), I am now getting this message in the console
(tomcat):
MyClass was created with the message factory
org.apache.logging.log4j.spi.MessageFactory2Adapter@796e8a0f and is now
requested with a null message factory (defaults to
org.apache.logging.log4j.message.ParameterizedMessageFactory), which may create
log events with unexpected formatting.
I am using org.apache.commons.logging.LogFactory bridge with these jars
log4j-1.2-api-2.5.jar
log4j-api-2.5.jar
log4j-core-2.5.jar
log4j-jcl-2.5.jar
log4j-slf4j-impl-2.5.jar
Not sure if it relates to this patch, but f it does any ideas how to resolve
the message?
Cheers
> Logger cache does not account for message factory
> -------------------------------------------------
>
> Key: LOG4J2-1180
> URL: https://issues.apache.org/jira/browse/LOG4J2-1180
> Project: Log4j 2
> Issue Type: Bug
> Components: API
> Affects Versions: 2.4.1
> Reporter: Gary Gregory
> Assignee: Gary Gregory
> Fix For: 2.5
>
> Attachments: LOG4J2-1180.diff
>
>
> 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:
> {code:java}
> Logger loggerA1 = LogManager.getLogger("A", messageFactory1);
> Logger loggerA2 = LogManager.getLogger("A", messageFactory2);
> {code}
> loggerA1 is the same as loggerA2.
> This is a problem if two unrelated code bases (jars) both the same Logger
> names|objects|classes.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]