exceptionfactory commented on a change in pull request #4739:
URL: https://github.com/apache/nifi/pull/4739#discussion_r551295426



##########
File path: 
nifi-nar-bundles/nifi-graph-bundle/nifi-graph-processors/src/main/java/org/apache/nifi/processors/graph/ExecuteGraphQueryRecord.java
##########
@@ -223,14 +237,19 @@ public void onTrigger(final ProcessContext context, final 
ProcessSession session
                     }
 
                     dynamicPropertyMap.putAll(input.getAttributes());
+                    if (getLogger().isDebugEnabled()) {
+                        getLogger().info("Parameter map: " + 
dynamicPropertyMap);

Review comment:
       Should this be changed to `getLogger().debug()`?  Using a parameterized 
logging statement with `dynamicPropertyMap` would also optimize the 
implementation:
   
   ```suggestion
                           getLogger().debug("Dynamic Properties: {}", new 
Object[]{dynamicPropertyMap});
   ```

##########
File path: 
nifi-nar-bundles/nifi-graph-bundle/nifi-graph-processors/src/main/java/org/apache/nifi/processors/graph/ExecuteGraphQueryRecord.java
##########
@@ -223,14 +237,19 @@ public void onTrigger(final ProcessContext context, final 
ProcessSession session
                     }
 
                     dynamicPropertyMap.putAll(input.getAttributes());
+                    if (getLogger().isDebugEnabled()) {
+                        getLogger().info("Parameter map: " + 
dynamicPropertyMap);
+                    }
                     List<Map<String, Object>> graphResponses = new 
ArrayList<>(executeQuery(recordScript, dynamicPropertyMap));
 
                     OutputStream graphOutputStream = session.write(graph);
                     String graphOutput = 
mapper.writerWithDefaultPrettyPrinter().writeValueAsString(graphResponses);
                     
graphOutputStream.write(graphOutput.getBytes(StandardCharsets.UTF_8));
                     graphOutputStream.close();
                     session.transfer(graph, GRAPH);
+                    records++;
                 } catch (Exception e) {
+                    getLogger().error("Error processing record", e);

Review comment:
       Is there any type of record identifier that could be included in the log 
message?  That could be useful when attempting to troubleshoot a problem if 
more than one record failed during this loop.




----------------------------------------------------------------
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]


Reply via email to