I need to have a log4j configuration for monitorInterval
. How can this be done with log4j.properties
?
In log4j.xml
it can be configured like this:
<Configuration monitorInterval="5">
What is the equivalent in log4j.properties
?
The file is named log4j. properties and is located in the $DGRAPH_HOME/dgraph-hdfs-agent/lib directory. The file defines the ROLLINGFILE appenders for the root logger and also sets the log level for the file. The level of the root logger is defined as INFO and attaches the ROLLINGFILE appender to it.
GOAL. Mule runtime uses log4j2 as the framework for logging. One may want to add or change the monitoring interval time that log4j will check for changes in the configuration file. In order to have this, the attribute "monitorInterval" needs to be added in the log4j2.
For log4j2
you can use this properties
file.
name = MainLogging
monitorInterval = 5
appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
rootLogger.level = ERROR
rootLogger.appenderRefs = stdout
rootLogger.appenderRef.console.ref = STDOUT
rootLogger.additivity = false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With