标签:
动态生成日志, 日志路径:
log4j2.xml 配置如下:
<?xml version="1.0" encoding="UTF-8"?> <Configuration> <Appenders> <File name="Log4jFile" append="true" fileName="logs/${date:yyyy-MM}/${date:yyyy-MM-dd}-log.log" bufferedIO="true" bufferSize="512"> <PatternLayout> <Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %p %c [%t] %m%n</Pattern> </PatternLayout> </File> </Appenders> <Loggers> <Root level="debug"> <AppenderRef ref="Log4jFile"/> </Root> </Loggers> </Configuration>
标签:
原文地址:http://www.cnblogs.com/julin-peng/p/5328898.html