NoSuchMethodError in log4j issue

During one of our deployment, we faced this issue where a spring-boot application failed to start.

Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.apache.log4j.net.SocketAppender.getThreshold()Lorg/apache/log4j/Priority;

Problem is this is working locally without any issue. It turns out there are some conflicts with different loggers used by springboot and our own modules. To fix this, we checked first which module is using log4j-over-slf4j and added it as an exclusion ie

<dependency>
<groupId>org.x.y.z</groupId>
<artifactId>xyz</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>

I got it here.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.