tpalfy commented on a change in pull request #5093:
URL: https://github.com/apache/nifi/pull/5093#discussion_r638752496
##########
File path:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/logging/repository/StandardLogRepository.java
##########
@@ -82,14 +83,25 @@ public void addLogMessage(final LogLevel level, final
String format, final Objec
addLogMessage(level, formattedMessage, t);
}
- private void replaceThrowablesWithMessage(Object[] params) {
+ private void replaceThrowablesWithMessage(final Object[] params) {
for (int i = 0; i < params.length; i++) {
- if(params[i] instanceof Throwable) {
- params[i] = ((Throwable) params[i]).getLocalizedMessage();
+ if (params[i] instanceof Throwable) {
+ params[i] = getCauses((Throwable) params[i]);
}
}
}
+ private static String getCauses(final Throwable throwable) {
+ final StringBuilder builder = new StringBuilder();
Review comment:
The code (and the Jira) suggests that the root cause exception should be
at the top (`Causes` instead of `Caused by`). This would mean the order of the
exception messages in the builder should be reversed.
Unfortunately however this might not even be the right place to handle the
exceptions. This works if an unexpected exception is caught and subsequently
reported by the framework. However direct calls to the `ComponentLog` methods
from the processor don't produce the wanted result.
##########
File path:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/logging/repository/StandardLogRepository.java
##########
@@ -34,7 +34,8 @@
public class StandardLogRepository implements LogRepository {
- public static final int DEFAULT_MAX_CAPACITY_PER_LEVEL = 10;
+ public static final String NEW_LINE_ARROW = "\u2517\u2501\u25B6";
Review comment:
We could use a dedicated unicode character instead.
```suggestion
public static final String NEW_LINE_ARROW = "\u21B3";
```
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]