NIFI-5652: Fixed LogMessage when logging level is disabled

This closes #3170.

Signed-off-by: Koji Kawamura <ijokarumawak@apache.org>
This commit is contained in:
Matthew Burgess 2018-11-14 10:50:37 -05:00 committed by Koji Kawamura
parent 4112af013d
commit 13011ac6d6
1 changed files with 2 additions and 13 deletions

View File

@ -156,12 +156,9 @@ public class LogMessage extends AbstractProcessor {
break;
}
if (!isLogLevelEnabled) {
transferChunk(session);
return;
if (isLogLevelEnabled) {
processFlowFile(logger, logLevel, flowFile, context);
}
processFlowFile(logger, logLevel, flowFile, context);
session.transfer(flowFile, REL_SUCCESS);
}
@ -202,12 +199,4 @@ public class LogMessage extends AbstractProcessor {
logger.debug(messageToWrite);
}
}
private void transferChunk(final ProcessSession session) {
final List<FlowFile> flowFiles = session.get(CHUNK_SIZE);
if (!flowFiles.isEmpty()) {
session.transfer(flowFiles, REL_SUCCESS);
}
}
}