zalando/logbook

logbook-logstash 3.9.0 requires slf4j 2.x which spring boot 3 depends on

sungho-rpls opened this issue · 2 comments

Description

logbook-logstash 3.9.0 uses boolean org.slf4j.Logger.isEnabledForLevel(org.slf4j.event.Level) function from slf4j 2(This is introduced by #1719 ). The problem is spring-boot 2 uses slf4j-api 1.x so the below error occur in spring boot 2.

java.lang.NoSuchMethodError: 'boolean org.slf4j.Logger.isEnabledForLevel(org.slf4j.event.Level)'
	at org.zalando.logbook.logstash.LogstashLogbackSink.isActive(LogstashLogbackSink.java:43)
	at org.zalando.logbook.core.DefaultLogbook.process(DefaultLogbook.java:49)
	at org.zalando.logbook.servlet.javax.LogbookFilter.process(LogbookFilter.java:98)
	at org.zalando.logbook.servlet.javax.LogbookFilter.doFilter(LogbookFilter.java:68)
	at org.zalando.logbook.servlet.javax.SecureLogbookFilter.doFilter(SecureLogbookFilter.java:32)
	at org.zalando.logbook.servlet.javax.HttpFilter.doFilter(HttpFilter.java:32)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

Please find slf4j-api version in this pages.
spring boot 2.7.x dependencies
spring boot 3.x dependencies

Expected Behavior

Actual Behavior

Possible Fix

Steps to Reproduce

  1. In spring boot2, logbook-logstash 3.9.0, logbook-servlet:3.9.0:javax, this error looks always occur

Context

Your Environment

  • Version used:
  • Link to your project:

@sungho-rpls It is better to update springboot or downgrade lookbook.