Log4j vulnerability solution (upgrade to version 2.15.0 or later)

Log4j vulnerability solution (upgrade to version 2.15.0 or later)

  1. In general, replace the configuration in the pom.xml file.
	<dependency>
	    <groupId>org.springframework.boot</groupId>
	    <artifactId>spring-boot-starter-log4j2</artifactId>
	</dependency>

	**替换为**

	<dependency>
	    <groupId>org.springframework.boot</groupId>
	    <artifactId>spring-boot-starter-log4j2</artifactId>
	    <exclusions>
	        <exclusion>
	            <groupId>org.apache.logging.log4j</groupId>
	            <artifactId>log4j-api</artifactId>
	        </exclusion>
	        <exclusion>
	            <groupId>org.apache.logging.log4j</groupId>
	            <artifactId>log4j-core</artifactId>
	        </exclusion>
	    </exclusions>
	</dependency>
	<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-core</artifactId>
	    <version>2.15.0</version>
	</dependency>

  1. In other cases (multi-module dependent projects), add configuration in parent/pom.xml.
	<log4j2.version>2.17.0</log4j2.version>

Guess you like

Origin blog.csdn.net/qq_33415990/article/details/122403889