ClassCastException: org.slf4j.impl.Log4jLoggerAdapter cannot be cast to ch.qos.logback.classic.Logger

后端 未结 4 455
面向向阳花
面向向阳花 2020-12-19 00:02

I was following this answer in order to add a appender on runtime. Even though that works for the original poster, I get this exception in line Logger logger = (Logger

4条回答
  •  萌比男神i
    2020-12-19 00:17

    Due to an already existing dependency of SLF4J in your project or in some other inherited project, there might be conflicts during runtime. Adding an exclusion to my POM file worked for me:

            
                
                    org.slf4j
                    slf4j-log4j12
                
            
    

提交回复
热议问题