在log4j2.properties中配置异步记录器不起作用

时间:2018-04-18 14:45:04

标签: log4j2

使adminLogger异步使用的配置 log4j2.properties无效。我用下面的代码来制作 记录器异步。

appender.adminAppender.type = RollingFile
appender.adminAppender.name = AdminAppender
appender.adminAppender.fileName = ${adminLogFile}
appender.adminAppender.filePattern = ${logPath}/admin-Backup-%i.log
appender.adminAppender.layout.type = PatternLayout
appender.adminAppender.layout.pattern = %d{yyyy.MM.dd HH.mm.ss.SSS} %-5p %c{1} [%t]: %m%n
appender.adminAppender.policies.type = Policies
appender.adminAppender.policies.size.type = SizeBasedTriggeringPolicy
appender.adminAppender.policies.size.size = 10MB
appender.adminAppender.strategy.type = DefaultRolloverStrategy
appender.adminAppender.strategy.max = 5

logger.adminLogger.type = asyncLogger
logger.adminLogger.name = admin
logger.adminLogger.level = debug
logger.adminLogger.additivity = false
logger.adminLogger.appenderRefs = adminAppender
logger.adminLogger.appenderRef.adminAppender.ref = AdminAppender

配置它的正确方法是什么?

0 个答案:

没有答案