Why do we need to add an additional dependency for log42j since all the transitive dependencies are already present in spring-boot-starter-web? From whatever tutorials I could read up on the internet everybody mentioned to add the dependency:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
They also mentioned excluding spring-boot-starter-logging from spring-boot-starter-web.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
But why do we need to do this? I see all the dependencies in spring-boot-starter-log4j2 are already there in spring-boot-starter-logging.