[
https://issues.apache.org/jira/browse/NIFI-1283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15086448#comment-15086448
]
James Wing commented on NIFI-1283:
----------------------------------
I agree there is a discrepancy between the code and the documentation, but I'm
not sure changing the docs is the right fix. It looks like the
ControllerStatusReportTask declares loggers using the getSimpleName() of the
class rather than using the full class name. This is why the logging
configuration works with "ControllerStatusReportTask" and not with
"org.apache.nifi.controller.ControllerStatusReportingTask".
{code:java|title=ControllerStatusReportTask.java|borderStyle=solid}
private static final Logger processorLogger =
LoggerFactory.getLogger(ControllerStatusReportingTask.class.getSimpleName() +
".Processors");
private static final Logger connectionLogger =
LoggerFactory.getLogger(ControllerStatusReportingTask.class.getSimpleName() +
".Connections");
{code}
However, it appears this choice of logger naming is unique to
ControllerStatusReportTask. All of the other loggers I found in casual code
analysis use the full class name, notably similar reporting tasks like
MonitorDiskUsage and MonitorMemory.
{code:java|title=MonitorDiskUsage.java|borderStyle=solid}
private static final Logger logger =
LoggerFactory.getLogger(MonitorDiskUsage.class);
{code}
{code:java|title=MonitorMemory.java|borderStyle=solid}
private static final Logger logger =
LoggerFactory.getLogger(MonitorMemory.class);
{code}
What do you think about changing the code to use the full class name, matching
the documentation and staying consistent with similar reporting functionality?
I would be willing to make the change.
> Documentation wrong for ControllerStatusReportingTask
> -----------------------------------------------------
>
> Key: NIFI-1283
> URL: https://issues.apache.org/jira/browse/NIFI-1283
> Project: Apache NiFi
> Issue Type: Bug
> Components: Documentation & Website
> Affects Versions: 0.4.0
> Reporter: Matthew Clarke
> Priority: Minor
> Labels: beginner, newbie
>
> The documentation explains how to separate the processor and connection
> logging out to a new log file. The logger names provided do not work.
> Original:
> If may be convenient to redirect the logging output of this ReportingTask to
> a separate log file than the typical application log. This can be
> accomplished by modified the logback.xml file in the NiFi conf/ directory
> such that a logger with the name
> org.apache.nifi.controller.ControllerStatusReportingTask is configured to
> write to a separate log.
> Additionally, it may be convenient to disable logging for Processors or for
> Connections or to split them into separate log files. This can be
> accomplished by using the loggers named
> org.apache.nifi.controller.ControllerStatusReportingTask.Processors and
> org.apache.nifi.controller.ControllerStatusReportingTask.Connections,
> respectively.
> The correct loggers to use would be:
> ControllerStatusReportingTask
> ControllerStatusReportingTask.Processors
> ControllerStatusReportingTask.Connections
> If you include the org.apache.nifi.controller protion the logger will not
> work.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)