Russell,
Apache NiFi logging uses LogBack[1]. If you look at "conf/logback.xml"[2]
you'll see <appender> and <logger> definitions. Appenders define named
logging destinations like "APP_FILE" and can configure the destination
type, log format, file name if applicable, rotation, size limits, etc.
Logger entries associate a package with a log level and an appender or the
default appender from the root logger.
Off the top of my head, this example should define a new appender and
associates it with output for any classes in the "com.test.nifi" package
tree.
<appender name="OTHER_FILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${org.apache.nifi.bootstrap.config.log.dir}/nifi-other.log</file>
... see [1] for additional details ...
</appender>
<logger name="com.test.nifi" level="INFO" additivity="false">
<appender-ref ref="OTHER_FILE"/>
</logger>
There is a lot more configuration detail in the LogBack manual, but I
suggest starting with a copy of one of the default appenders until you have
something working.
Regards,
Joe S
[1]https://logback.qos.ch/
[2]
https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/logback.xml
[3]https://logback.qos.ch/manual/configuration.html
On Tue, Feb 28, 2017 at 7:03 PM, Russell Bateman <[email protected]>
wrote:
> This question may arise a little out of naivety on my part.
>
> I need to create a new separate log, not to log the stuff I'm already
> logging and that appears nicely in /nifi-app.log/, but a sort of auditing
> log to which I'll write with comparative infrequency and very little
> verbosity. I'd like to create it in ${NIFI_ROOT}//logs/ alongside the
> existing logs since that's already a place to which I have write-access.
>
> What I'm looking for is to remain inside how ComponentLogworks if that's
> best practice. How to create another logfile alongside /nifi-app.log/ and
> /nifi-bootstrap.log/? Alternatively, do you suggest that I'm on my own and
> I should just use whatever I'm most familiar with (in my case, log4j +
> /log4j.properties///log4j.xml/)?
>
> Thanks.
>