1. 程式人生 > 其它 >springboot 解決log4j2漏洞

springboot 解決log4j2漏洞

1、通過pom依賴管理進行指定最新版本


<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.15.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.15.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.15.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jul</artifactId>
<version>2.15.0</version>
</dependency>
</dependencies>
</dependencyManagement>

2、配置直接指定log4j2的版本

<properties>
<log4j2.version>2.15.0</log4j2.version>
</properties>