1

Why spring-boot-starter package use log4j logger by default, instead of log4j2?

Advantages of log4j2 (see also official page) can be found in the another stackoverflow question. Important items:

  1. Async logging (which is faster for consumer code)
  2. Less memory traffic
  3. Actively maintained by community
1615903
  • 32,635
  • 12
  • 70
  • 99
Manushin Igor
  • 3,398
  • 1
  • 26
  • 40

1 Answers1

0

Spring Boot does not use log4j by default, it uses Logback. From the documentation:

Spring Boot has a LoggingSystem abstraction that attempts to configure logging based on the content of the classpath. If Logback is available, it is the first choice.

It only uses log4j if it is available in the classpath and logback is not.

1615903
  • 32,635
  • 12
  • 70
  • 99