Carl, I think logging still works in ExecuteScript. But starting in NiFi 1.0, the default log level for processors was set from 'INFO' back to 'WARN' to reduce log volumes. To receive INFO messages from ExecuteScript, you will want to do one or both of two things:
1.) Set the bulletin level of the specific ExecuteScript processor to 'INFO'. This will let you see the log messages directly in the UI, although the bulletin mechanism has an error handling feel to it. 2.) Configure conf/logback.xml to set the log capture level to 'INFO' for the ExecuteScript processor. This requires something like the following: <logger name="org.apache.nifi.processors.script.ExecuteScript" level="INFO"/> There is a similar entry for LogAttribute around line 90. After doing this, you should see your info messages in the nifi-app.log file. I hope that helps. Thanks, James On Thu, Feb 9, 2017 at 9:12 AM, Carl Berndt <[email protected]> wrote: > Hi, > > I recently upgraded from version 0.7 to 1.1.1 > This can be recreated in Windows and Linux (Amazon Ec2). > > The log.info is not working in 1.1.1 from a Groovy script. > It did work in nifi 0.7 with groovy script 'ExecuteScript processor'. > > I fed the ExecuteScript with a Generate Flow File processor. > Here is the test script I used to prove it: 6 lines... > > log.info("Hello from Groovy!") ; > def flowFile = session.get(); > if (!flowFile) return; > > flowFile = session.putAttribute(flowFile, 'my-property', 'my-value'); > session.transfer(flowFile, REL_SUCCESS) > > Here is the output I get: > (snippets from the nifi-app.log's) > > version 0.7.1 windows > 2017-02-09 10:29:28,810 INFO [StandardProcessScheduler Thread-4] > o.a.n.c.s.TimerDrivenSchedulingAgent > Scheduled GenerateFlowFile[id=603b4bc8-ca9b-48b9-abb8-11967b6f28bf] to > run with 1 threads > 2017-02-09 10:29:31,643 INFO [StandardProcessScheduler Thread-1] > o.a.n.c.s.TimerDrivenSchedulingAgent > Scheduled ExecuteScript[id=e2fa6e2b-caa5-40af-be1c-d265b2509941] to run > with 1 threads > 2017-02-09 10:29:32,791 INFO [Timer-Driven Process Thread-2] > o.a.nifi.processors.script.ExecuteScript > ExecuteScript[id=e2fa6e2b-caa5-40af-be1c-d265b2509941] > Hello from Groovy! > > version 1.1.1 windows > no log.info() results outputted in nifi-app.log > > 2017-02-09 10:44:53,390 INFO [StandardProcessScheduler Thread-3] > o.a.n.c.s.TimerDrivenSchedulingAgent > Scheduled GenerateFlowFile[id=f6d91eaa-100c-115a-957e-f0f9c124ad13] to > run with 1 threads > 2017-02-09 10:44:53,524 INFO [StandardProcessScheduler Thread-4] > o.a.n.c.s.TimerDrivenSchedulingAgent > Scheduled ExecuteScript[id=f6d91ea9-100c-115a-6c5c-bd8ae0e515d4] to run > with 1 threads > 2017-02-09 10:44:55,240 INFO [Flow Service Tasks Thread-1] > o.a.nifi.controller.StandardFlowService Saved flow controller > org.apache.nifi.controller.FlowController@3429ba07 // Another save > pending = false > > 2017-02-09 10:44:56,509 INFO [NiFi Web Server-18] > o.a.n.controller.StandardProcessorNode > Stopping processor: class org.apache.nifi.processors.script.ExecuteScript > 2017-02-09 10:44:56,520 INFO [StandardProcessScheduler Thread-8] > o.a.n.c.s.TimerDrivenSchedulingAgent > Stopped scheduling ExecuteScript[id=f6d91ea9-100c-115a-6c5c-bd8ae0e515d4] > to run > > > This same problem also occurs in my amazon ec2 nifi 1.1.1. > > workaround: > I can use a groovy print() to cause output to show in the bootstrap .log > file..... > > Thanks for a product! > Carl >
