nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (NIFI-985) Custom log prefix for LogAttribute processor
Date Tue, 22 Sep 2015 13:53:04 GMT

    [ https://issues.apache.org/jira/browse/NIFI-985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14902663#comment-14902663
] 

ASF GitHub Bot commented on NIFI-985:
-------------------------------------

Github user apiri commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/90#discussion_r40088113
  
    --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/LogAttribute.java
---
    @@ -123,11 +131,15 @@ protected void init(final ProcessorInitializationContext context)
{
         protected String processFlowFile(final ProcessorLog logger, final DebugLevels logLevel,
final FlowFile flowFile, final ProcessSession session, final ProcessContext context) {
             final Set<String> attributeKeys = getAttributesToLog(flowFile.getAttributes().keySet(),
context);
             final ProcessorLog LOG = getLogger();
    -
    +        String logPrefix = context.getProperty(LOG_PREFIX).getValue();
             // Pretty print metadata
             final StringBuilder message = new StringBuilder();
             message.append("logging for flow file ").append(flowFile);
             message.append("\n");
    +        if (logPrefix != null) {
    +            message.append(logPrefix);
    +            message.append(" ");
    +        }
             message.append(FIFTY_DASHES);
    --- End diff --
    
    Since we are changing the output format would like to see a String.format or something
similar to give a consistent width with number of dashes.


> Custom log prefix for LogAttribute processor
> --------------------------------------------
>
>                 Key: NIFI-985
>                 URL: https://issues.apache.org/jira/browse/NIFI-985
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Core Framework
>            Reporter: Joe Mészáros
>            Priority: Minor
>              Labels: improvement, log
>         Attachments: log_prefix.png
>
>
> When you have a data flow with a bunch of LogAttribute processors it is really hard to
identify the right LogAttribute processor in the log file and distinguish the output of different
LogAttribute processors.
> There is a new property, called log prefix, which helps the user to set a custom log
prefix for each Log Attribute processor, which will appear in the log output of the processor.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message