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

后端 未结 4 452
面向向阳花
面向向阳花 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条回答
  •  春和景丽
    2020-12-19 00:02

    In this case make sure that the library you are using for Logger and LoggerFactory should be the same For example if LoggerFactory is from slf4j then Logger should not be of log4j or java.util. Make sure it is also from slf4j. Let me know if you still face the issue.

提交回复
热议问题