You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "exceptionfactory (via GitHub)" <gi...@apache.org> on 2023/06/01 21:25:23 UTC

[GitHub] [nifi] exceptionfactory commented on a diff in pull request #7326: NIFI-11628: Fixed Object[] + Throwable argument substitution in Simpl…

exceptionfactory commented on code in PR #7326:
URL: https://github.com/apache/nifi/pull/7326#discussion_r1213695849


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/processor/SimpleProcessLogger.java:
##########
@@ -91,7 +91,8 @@ public void warn(final String msg, final Object[] os, final Throwable t) {
                 logger.warn(componentMessage, arguments);
                 logRepository.addLogMessage(LogLevel.WARN, componentMessage, arguments);
             } else {
-                logger.warn(componentMessage, arguments, t);
+                final Object[] argumentsWithThrowable = insertThrowable(arguments, t);
+                logger.warn(componentMessage, setFormattedThrowable(argumentsWithThrowable, t));

Review Comment:
   `setFormattedThrowable` adds both `Throwable.toString()` and `Throwable`, which is not generally what should happen. For this to work properly, the formatted component message would also need to change, however, the `Throwable.toString()` should not be part of the log message.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org