📌  相关文章
📜  File Appender log4j2.properties spring - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:49.704000             🧑  作者: Mango

代码示例1
rootLogger.level = INFO
property.filename = application.log
appenders = R, console

appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d %5p [%t] (%F:%L) - %m%n

appender.R.type = RollingFile
appender.R.name = File
appender.R.fileName = ${filename}
appender.R.filePattern = ${filename}.%d{yyyy-MM-dd}
appender.R.layout.type = PatternLayout
appender.R.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n
appender.R.policies.type = Policies
appender.R.policies.time.type = TimeBasedTriggeringPolicy
appender.R.policies.time.interval = 1

rootLogger.appenderRefs = R, console

rootLogger.appenderRef.console.ref = STDOUT
rootLogger.appenderRef.R.ref = File