Member since
01-06-2018
4
Posts
0
Kudos Received
0
Solutions
05-08-2018
05:03 PM
Hi @Gilvan, Thanks for answering. The problem is NOT showing two lines with same information. But two prefix in one log: 2018-05-04 13:30:32,265 INFO 2018-05-04 13:30:32,265 INFO Thanks! Alex
... View more
05-04-2018
08:52 PM
Hi, In one of my project, I need to redirect Nifi logs to console/terminal. Here is my logback.xml <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date %level %msg%n</pattern>
</encoder>
</appender>
....
<logger name="org.apache.nifi.bootstrap" level="INFO" additivity="false">
<appender-ref ref="BOOTSTRAP_FILE" />
</logger>
<logger name="org.apache.nifi.bootstrap.Command" level="INFO" additivity="false">
<appender-ref ref="BOOTSTRAP_FILE" />
</logger>
<!-- Everything written to NiFi's Standard Out will be logged with the logger org.apache.nifi.StdOut at INFO level -->
<logger name="org.apache.nifi.StdOut" level="INFO" additivity="true">
<appender-ref ref="CONSOLE" />
<appender-ref ref="BOOTSTRAP_FILE" />
</logger>
<!-- Everything written to NiFi's Standard Error will be logged with the logger org.apache.nifi.StdErr at ERROR level -->
<logger name="org.apache.nifi.StdErr" level="ERROR" additivity="false">
<appender-ref ref="BOOTSTRAP_FILE" />
</logger>
<root level="INFO">
<appender-ref ref="CONSOLE" />
<appender-ref ref="APP_FILE"/>
</root>
However, messages in console are logged twice. (Timestamp, Level appear twice) 2018-05-04 13:30:32,265 INFO 2018-05-04 13:30:32,265 INFO Initiating checkpoint of FlowFile Repository
2018-05-04 13:30:32,265 INFO 2018-05-04 13:30:32,265 INFO Initiating checkpoint of FlowFile Repository
2018-05-04 13:30:32,403 INFO 2018-05-04 13:30:32,403 INFO org.wali.MinimalLockingWriteAheadLog@22f8be7c checkpointed with 40 Records and 91 Swap Files in 138 milliseconds (Stop-the-world time = 72 milliseconds, Clear Edit Logs time = 61 millis), max Transaction ID 7501026
consoleLogs.png I try following ways 1. Remove <appender-ref ref="CONSOLE" /> in root logger 2. Remove <appender-ref ref="CONSOLE" /> in stdout logger 3.Use customized stdout appender like this post But they either make no change or do not show logs on console at all. Any help would be appreciated. Thanks!
... View more
Labels:
- Labels:
-
Apache NiFi
01-10-2018
09:28 PM
Thanks Matt! Good to know that!
... View more
01-08-2018
08:01 PM
Hello there, I have problem casting a plain text which is already in valid JSON format to JSON data type. textdata.png I want to it to convert the content type from text/plain to application/json. I failed to do so by both ConvertRecord and AttributesToJSON. For ConvertRecord, since it is not in any data format, none of the reader applies on such Flowfile. For AttributesToJSON, I tried to use EvaluateJsonPath to put entire text into an attribute then used AttributesToJSON but the JSON object will become totally messed up especially with arrays and strings. (The actual data I am working with is more complicated than this example) Anyone has good idea to do this? Thanks in advance!
... View more
Labels:
- Labels:
-
Apache NiFi