简体   繁体   English

如何在log4j1.6中的log4j.properties中配置monitorInterval

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM