[英]How to configure monitorInterval in log4j.properties in log4j1.6
I need to have a log4j configuration for monitorInterval
. 我需要为
monitorInterval
配置log4j。 How can this be done with log4j.properties
? 如何使用
log4j.properties
完成此操作?
In log4j.xml
it can be configured like this: 在
log4j.xml
它可以像这样配置:
<Configuration monitorInterval="5">
What is the equivalent in log4j.properties
? log4j.properties
的等价物是什么?
For log4j2
you can use this properties
file. 对于
log4j2
您可以使用此properties
文件。
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
The equivalent is configureAndWatch, see the symmetric question here: 等效的是configureAndWatch,请参阅此处的对称问题:
How to implement "configureAndWatch" in log4j2 如何在log4j2中实现“configureAndWatch”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.