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

Stefan Hammelbeck commented on LOG4J2-1688:
-------------------------------------------

Hi [~ralphgoers]!

We actually don’t have a problem logging one argument only. We don't even issue 
this logging by ourselves, instead it is done indirectly by DBUnit.

Our problem is that the logging 
{code}
((ExtendedLogger)log4JLogger).logIfEnabled("test", Level.ERROR, null, "test 
{}", args);
{code}

happens twice (*in DBUnit*), which sets all elements of {{args}} to {{null}}, 
i.e. the double-logging has a side effect on the passed argument {{args}}. 
Unfortunately, as it’s done by DBUnit, we cannot change the logging of {{args}} 
to {{Arrays.toString(args)}} which would actually work.


> Multiple loggings of arguments are setting these arguments to null
> ------------------------------------------------------------------
>
>                 Key: LOG4J2-1688
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1688
>             Project: Log4j 2
>          Issue Type: Bug
>    Affects Versions: 2.7
>            Reporter: Stefan Hammelbeck
>
> We are using SLF4J over log4j Version 2.7.
> Calling {{org.slf4j.Logger.error(someFormat, args)}} *twice* with an 
> {{Object[] args}}  causes all elements of {{args}} to be set to {{null}}.



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

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

Reply via email to