python - Nifi ExecuteScript 处理器与 Python 引擎不记录信息

标签 python apache-nifi

我使用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/

相关文章:

python - 不正确的清新使用测试结果

python - 是否可以设置 m2m 对象与其自身不具有递归关系?

python - 将 xlsx 转换为 parquet

mysql - 使用 apache-nifi 从流文件内容查询数据库记录以检索数据

Apache NiFi 中的 Json 字段匹配

python - 将 Json 文件读取为 Pandas Dataframe 错误

python - 提取子DataFrame

python - 当 Popen 错误时,子进程的 Popen 关闭在另一个线程中使用的 stdout/stderr 文件描述符

bigdata - NiFi内存管理

apache-nifi - Apache NiFi 支持循环吗?