Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure monitorInterval in log4j.properties in log4j1.6

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?

like image 695
balamost Avatar asked Apr 08 '15 11:04

balamost


People also ask

How do you set a log4j properties file location?

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.

What is monitorInterval in log4j2?

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.


1 Answers

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
like image 118
stanly Avatar answered Nov 14 '22 21:11

stanly