运维开发网

SpringBoot 2.1.1.RELEASE 集成log4j2

运维开发网 https://www.qedev.com 2020-02-13 09:11 出处:网络 作者:铁牛2020
SpringBoot 2.1.1.RELEASE 集成log4j2

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

0

精彩评论

暂无评论...
验证码 换一张
取 消