danoyoung danoyoung - 24 days ago 6
Groovy Question

log.info in ExecuteScript

I'm trying to log in an ExecuteScript component using Groovy. Whenever I call log.info nothing is written to the nifi-app.log, but when I call log.errorit does. Is there some log4j config or something else I need to do?

Using Nifi 1.0.x

In my test.groovy script:

log.info("FOO-BAZ-INFO")
=> nothing

log.error("FOO-BAZ-ERROR")
=>
2016-11-15 10:29:24,023 ERROR [Timer-Driven Process Thread-6] o.a.nifi.processors.script.ExecuteScript ExecuteScript[id=6840347a-0158-1000-ebbf-b9af3aefa022] FOO-BAZ-ERROR

Answer

In conf/logback.xml, try adding the following line:

<logger name="org.apache.nifi.processors.script.ExecuteScript" level="INFO"/>

By default I believe all processors (except LogAttribute) log at the WARN level, you can either change them individually like the above, or change all of them by changing the following line:

<logger name="org.apache.nifi.processors" level="WARN"/>

from WARN to INFO