I'm using spring-boot-starter
, and would like to configure log4j2.xml
to log asynchron + different content to different logfiles.
I created the log4j2 file, but Spring
still uses the spring-boot default logging. How can I switch the logging?
I've a better way:
Exclude logback logger:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
Add log4j2 boot starter:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
Enjoy!