I need to use slf4j with log4j2 in my application. But in all the blogs and tutorials it says - "We would need to exclude the dependency on spring-boot-starter-logging and add a dependency on spring-boot-starter-log4j2."
I understand internally spring-boot-starter-logging uses log4j/logback/spring-jcl etc but not log4j2. But my doubt is why we need to exclude 'spring-boot-starter-logging' , can't we just add 'spring-boot-starter-log4j2' and start using log4j2. ? Why to exclude 'spring-boot-starter-logging' ?