我使用Python引擎实现了Nifi ExecuteScript处理器,我已将脚本文件属性指向了ExecuteScript处理器中的python文件。在我的python代码中,我使用了log.error('Error')和log.info('Hello'),其中我只能在nifi-app.log文件中看到log.error,而log.info没有显示。
flowFile = session.get()
if flowFile != None:
try:
log.info('Info >> Python processor started') #1
log.error('Python processor started') #2
applicationId = flowFile.getAttribute('http.param.applicationId')
flowFile = session.write(flowFile, ModJSON())
flowFile = session.putAttribute(flowFile, "filename",
flowFile.getAttribute('filename').split('.')[0] + '_translated_response.json')
flowFile = session.putAttribute(flowFile,"http.param.applicationId",applicationId)
session.transfer(flowFile, REL_SUCCESS)
log.error('Python processor completed')
except:
log.error('Error while sequencing ')
session.transfer(flowFile, REL_FAILURE)
session.commit()
从上面的代码第 #2 行在日志文件中显示错误,但第 1 行未记录
最佳答案
请检查 /<nifi installation path>/conf/logback.xml
的日志级别。我认为您的处理器日志级别是 warn
不是info
.
关于python - Nifi ExecuteScript 处理器与 Python 引擎不记录信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57248415/