lordgamez commented on code in PR #1713:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1713#discussion_r1447343003
##########
CONFIGURE.md:
##########
@@ -560,3 +631,92 @@ To notify the agent which extensions it should load see
[Loading extensions](Ext
### JNI Functionality
Please see the [JNI Configuration Guide](JNI.md).
+
+## Log configuration
+By default the application logs for Apache MiNiFi C++ can be found in the
${MINIFI_HOME}/logs/minifi-app.log file with default INFO level logging. The
logger can be reconfigured in the ${MINIFI_HOME}/conf/minifi-log.properties
file to use different output streams, log level, and output format.
+
+### Log appenders
+In the configuration file it is possible to define different output streams by
defining what type of appenders (log sinks) should be used for logging. The
following appenders are supported:
+- rollingappender - logs written to this log sink are written to a file with a
rolling policy
+- stdout - logs written to this log sink are written to the standard output
+- stderr - logs written to this log sink are written to the standard error
+- syslog - logs written to this log sink are written to the syslog
+- alert - logs written to this log sink are critical logs forwarded through
HTTP as alerts
+- nullappender - logs written to this log sink are discarded
+
+Defining a new appender can be done in the format `appender.<appender
name>=<appender type>` followed by defining its properties. For example here is
how to define a rolling file appender:
+
+ # in minifi-log.properties
+ appender.rolling=rollingappender
+ appender.rolling.directory=${MINIFI_HOME}/logs
+ appender.rolling.file_name=minifi-app.log
+ appender.rolling.max_files=3
+ appender.rolling.max_file_size=5 MB
+
+Here's an example of an alert appender with its available properties:
+
+ # in minifi-log.properties
+ appender.alert1=alert
+ appender.alert1.url=<URL>
+ appender.alert1.filter=<regex pattern to match logs against>
+ appender.alert1.rate.limit=10 min
+ appender.alert1.flush.period=5 s
+ appender.alert1.batch.size=100 KB
+ appender.alert1.buffer.limit=1 MB
+ appender.alert1.level=TRACE
+ appender.alert1.ssl.context.service=<Name of the SSLContextService>
+
+### Log levels
+After the appenders are defined you can set the log level and logging target
for each of them. Appenders can be set to log everything on a specific log
level, but you can also define some appenders to only write logs from specific
namespaces or classes with different log levels. The log level can be set to
one of the following values: OFF, TRACE, DEBUG, INFO, WARN, ERROR. The log
levels can be set in the following way:
+
+ # in minifi-log.properties
+ # Set the rolling appender to log everything with INFO level
+ logger.root=INFO,rolling
+ # But only write logs from the org::apache::nifi::minifi::FlowController
class with ERROR level
+
logger.org::apache::nifi::minifi::core::logging::LoggerConfiguration=ERROR,rolling
Review Comment:
Good catch, updated in 999a2039a9457abf91dae7af2f75a5910d7ce86f
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]