2020-08-04 19:39:51,762 INFO [NiFi Web Server-119] o.a.n.controller.StandardProcessorNode Starting GenerateFlowFile[id=ba947905-0173-1000-d104-9e557d7a6e94]
2020-08-04 19:39:51,762 INFO [Timer-Driven Process Thread-7] o.a.n.c.s.TimerDrivenSchedulingAgent Scheduled LogAttribute[id=ba94af15-0173-1000-3f99-5d91aebbeee9] to run with 1 threads
2020-08-04 19:39:51,763 INFO [Timer-Driven Process Thread-4] o.a.n.c.s.TimerDrivenSchedulingAgent Scheduled GenerateFlowFile[id=ba947905-0173-1000-d104-9e557d7a6e94] to run with 1 threads
2020-08-04 19:39:52,135 INFO [Timer-Driven Process Thread-2] o.a.n.c.s.TimerDrivenSchedulingAgent Scheduled ExecuteScript[id=bc72b93f-0173-1000-0716-e5b91a545dc5] to run with 1 threads
2020-08-04 19:39:52,139 WARN [Timer-Driven Process Thread-3] o.a.nifi.processors.script.ExecuteScript ExecuteScript[id=bc72b93f-0173-1000-0716-e5b91a545dc5] Running inside the python script: 2020-08-04 19:39:51.763 -0700
Python内置的
print()
函数打印到标准输出(即通常是控制台)。在NiFi,这对你不起作用。您应该使用框架注入到脚本中的log
对象。此log
对象具有多个函数,允许以不同的严重性级别(debug
、info
、warn
、error
等)进行输出。默认情况下,ExecuteScript
处理器只在warn
或更高级别写入消息,因此您可以使用log.warn("my message")
或在conf/logback.xml
中更改处理器的默认日志级别。输出将显示在logs/nifi-app.log
文件中示例脚本(将
existing_attr
设置为前一个处理器的当前时间):在
logs/nifi-app.log
中输出(最后一行来自脚本内部):More info about getting started with scripting in NiFi
相关问题 更多 >
编程相关推荐