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

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

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

    https://github.com/apache/nifi/pull/1737#discussion_r116506100
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/LogString.java
 ---
    @@ -0,0 +1,208 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.nifi.processors.standard;
    +
    +import org.apache.nifi.annotation.behavior.EventDriven;
    +import org.apache.nifi.annotation.behavior.InputRequirement;
    +import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
    +import org.apache.nifi.annotation.behavior.SideEffectFree;
    +import org.apache.nifi.annotation.behavior.SupportsBatching;
    +import org.apache.nifi.annotation.documentation.CapabilityDescription;
    +import org.apache.nifi.annotation.documentation.Tags;
    +import org.apache.nifi.components.PropertyDescriptor;
    +import org.apache.nifi.flowfile.FlowFile;
    +import org.apache.nifi.logging.ComponentLog;
    +import org.apache.nifi.processor.AbstractProcessor;
    +import org.apache.nifi.processor.ProcessContext;
    +import org.apache.nifi.processor.ProcessSession;
    +import org.apache.nifi.processor.ProcessorInitializationContext;
    +import org.apache.nifi.processor.Relationship;
    +import org.apache.nifi.processor.exception.ProcessException;
    +import org.apache.nifi.processor.util.StandardValidators;
    +import org.eclipse.jetty.util.StringUtil;
    +
    +import java.util.ArrayList;
    +import java.util.Collections;
    +import java.util.HashSet;
    +import java.util.List;
    +import java.util.Set;
    +
    +@EventDriven
    +@SideEffectFree
    +@SupportsBatching
    +@Tags({"attributes", "logging"})
    +@InputRequirement(Requirement.INPUT_REQUIRED)
    +@CapabilityDescription("Emits a log message at the specified log level")
    +public class LogString extends AbstractProcessor {
    --- End diff --
    
    Although "String" is a ubiquitous term, most of the documentation 
(description, properties, e.g.) refers to logging a "message". Although not 
required, I recommend changing the name of this processor to LogMessage, what 
do you think?  If you agree, be sure to update the resources file and test 
class name too, please and thanks!


> Add new processor to log user defined messages built with NiFi Expression 
> Language
> ----------------------------------------------------------------------------------
>
>                 Key: NIFI-3763
>                 URL: https://issues.apache.org/jira/browse/NIFI-3763
>             Project: Apache NiFi
>          Issue Type: New Feature
>          Components: Core Framework
>            Reporter: Peter Horvath
>            Priority: Minor
>
> Sometimes it would be very useful to have a NiFi processor, which can simply 
> log messages as defined by the DataFlow Manager (DFM/operator). 
> Such functionality would be a powerful aid for _debugging_ running NiFi 
> dataflows. The DFM should be able to specify the single line log message 
> using NiFi Expression Language. Similarly to the existing LogAttribute 
> processor, the DataFlow Manager should be able to specify the log level 
> (trace, debug, info, warn, error) at which the log line is written. 
> While the functionality can be achieved by combining UpdateAttribute and 
> LogAttribute processor nodes, having to use three separate nodes (adding the 
> log message as an attribute, logging the attribute, then removing the 
> attribute from the flowfile's processing context) and a temporary attribute 
> to convey the message is overly complex and clutters the flow diagram. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to