[
https://issues.apache.org/jira/browse/NIFI-1731?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Joseph Witt updated NIFI-1731:
------------------------------
Fix Version/s: (was: 0.7.0)
> CapturingLogger mishandles formatted messages
> ---------------------------------------------
>
> Key: NIFI-1731
> URL: https://issues.apache.org/jira/browse/NIFI-1731
> Project: Apache NiFi
> Issue Type: Bug
> Reporter: Oleg Zhurakousky
> Assignee: Oleg Zhurakousky
> Priority: Minor
>
> Here is the example of such mishandling
> {code}
> public void warn(String format, Object arg) {
> warnMessages.add(new LogMessage(null, format, null, arg));
> logger.warn(format, arg);
> }
> {code}
> where it really has to be
> {code}
> public void warn(String format, Object arg) {
> Object[] args = new Object[] { arg };
> warnMessages.add(new LogMessage(null,
> MessageFormatter.arrayFormat(format, args).getMessage(), null, args));
> logger.warn(format, arg);
> }
> {code}
> Basically instead of _message_ we are currently passing _format_ into the
> 'message' field of LogMessage constructor which results in something like
> "{}" being the value of the message
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)