Created on 09-26-2021 11:28 PM - edited 09-16-2022 07:43 AM
Hi,
I am using CM 6.3.1 with CFM. As I am exploring NIFI -> ControllerStatusReportingTask and I wanted to log the output to a log file. I realised the logback.xml is auto generated by Cloudera Manager, how am I going to add customize logback configuration for the ControllerStatusReportingTask into the logback.xml?
From the CM, there is a NIFI Node XML Override (logback_safety_valve). Should I use this?
It seems that, the input require a complete logback XML file. Just wanted to be sure of the approach as I will be upgrading on my production system.
Created 09-27-2021 10:57 AM
You are absolutely correct, the Cloudera Manager configuration property within NiFi configurations fro logback.xml does require you to input the entire logbck.xml and then add your modifications.
Adding a new logger for the ControllerStatusReportingTask would require adding a logger like this:
<logger name="org.apache.nifi.controller.ControllerStatusReportingTask" level="DEBUG"/>
You can add this logger in line along with other loggers already in the logback.xml
The result would be all logging from this class at a DEBUG level and below would go in to the nifi-app.log.
You could optionally add an additional appender (NiFi has three existing appender now for the nifi-app.log, nifi-user.log and nifi-bootstrap.log files). You can copy and modify one of those and the your logger would need to look like this:
<logger name="org.apache.nifi.controller.ControllerStatusReportingTask" level="DEBUG" additivity="false">
<appender-ref ref="NEW_APPENDER"/>
</logger>
If you found this response assisted with your query, please take a moment to login and click on "Accept as Solution" below this post.
Thank you,
Matt
Created 09-27-2021 10:57 AM
You are absolutely correct, the Cloudera Manager configuration property within NiFi configurations fro logback.xml does require you to input the entire logbck.xml and then add your modifications.
Adding a new logger for the ControllerStatusReportingTask would require adding a logger like this:
<logger name="org.apache.nifi.controller.ControllerStatusReportingTask" level="DEBUG"/>
You can add this logger in line along with other loggers already in the logback.xml
The result would be all logging from this class at a DEBUG level and below would go in to the nifi-app.log.
You could optionally add an additional appender (NiFi has three existing appender now for the nifi-app.log, nifi-user.log and nifi-bootstrap.log files). You can copy and modify one of those and the your logger would need to look like this:
<logger name="org.apache.nifi.controller.ControllerStatusReportingTask" level="DEBUG" additivity="false">
<appender-ref ref="NEW_APPENDER"/>
</logger>
If you found this response assisted with your query, please take a moment to login and click on "Accept as Solution" below this post.
Thank you,
Matt