logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry West (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1583) Nested logging call disrupts output of outer logging call
Date Fri, 16 Sep 2016 00:32:20 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-1583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15494962#comment-15494962
] 

Larry West commented on LOG4J2-1583:
------------------------------------

[~mikaza] hmm... you're right. I misread my own sample output: it does not occur with 2.5.
I only debugged into the issue while configured for 2.6.2.  Thanks for pointing that out!

h4. incorrect output {{2.6}}, {{2.6.1}}, {{2.6.2}}
{noformat}
17:27:20.711 INFO  [main] problem.demo.apache.log4j2.Log4j2ProblemDemo - getX: values x=3
y=4 z=5
17:27:20.712 INFO  [main] problem.demo.apache.log4j2.Log4j2ProblemDemo - getX: values x=3
y=4 z=5[Thing x=3 y=4 z=5]
{noformat}

h4. correct output {{2.5}}
{noformat}
17:24:06.298 INFO  [main] problem.demo.apache.log4j2.Log4j2ProblemDemo - getX: values x=3
y=4 z=5
17:24:06.299 INFO  [main] problem.demo.apache.log4j2.Log4j2ProblemDemo - main: argCount=0
it=[Thing x=3 y=4 z=5]
{noformat}

> Nested logging call disrupts output of outer logging call
> ---------------------------------------------------------
>
>                 Key: LOG4J2-1583
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1583
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.6, 2.6.1, 2.6.2
>         Environment: JVM 1.8.0_102, MacOS 10.11.6
>            Reporter: Larry West
>         Attachments: LOG4J-1583.tbz2, Log4j2ProblemDemo.java, log4j2.xml, pom.xml
>
>
> If a call to logger.info() invokes the toString() method on one of its parameters, and
that toString() method invokes another method which has another, nested logging call, then
the output of the outer call is mangled.
> This can be quite confusing as the nested logging may be conditional, or at DEBUG level,
etc.
> Problem _appears_ to be related to ReusableParameterizedMessage.swapMessage() and the
values in indices[].  (It looks inherently non-reentrant.)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message