1. 程式人生 > >SpringBoot 2.1.1.RELEASE 集成log4j2

SpringBoot 2.1.1.RELEASE 集成log4j2

log4 sys 集成 con roo prop -s www. logger

http://www.qchcloud.cn/system/article/show/66
步驟1:

添加依賴:

org.springframework.boot spring-boot-starter-log4j2 過濾: org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-logging 步驟2:
配置log4j2.xml

<?xml version="1.0" encoding="UTF-8"?>
<loggers>

<root level="all">
<appender-ref ref="Console"/>
<appender-ref ref="RollingFileInfo"/>
</root>
</loggers>

步驟3:
application.properties

log4j配置

logging.config=classpath:log4j2.xml

SpringBoot 2.1.1.RELEASE 集成log4j2