zalando/logbook

Logbook stopped logging request and responses after switching from version 2.0.16 to version 3.0.0

et-ceter-a opened this issue · 3 comments

Hi,

I am using java 17 with spring boot version 2.7.3. I have added following dependencies in my build.gradle:

implementation "org.zalando:logbook-spring-boot-starter:3.0.0"
implementation "org.zalando:logbook-json:3.0.0"
implementation "org.zalando:logbook-servlet:3.0.0"

Automatically spring-boot-starter pulls logging dependencies as

ch.qos.logback:logback-core:1.2.11
ch.qos.logback:logback-classic:1.2.11
org.slf4j:slf4j-api:1.7.36
org.slf4j:jul-to-slf4j:1.7.36
All logging settings are standard, not overridden in any way.

After adding these dependencies, I added following configurations in application.yml:
logging.level.org.zalando.logbook: TRACE

And as it says in #1532 - I pointed out
@ImportAutoConfiguration(classes = LogbookAutoConfiguration.class)

Can any one please guide what I am doing wrong as I am unable to run Logbook and nothing is being logged in console.
Important notice-if I switch to logbook version 2.16.0 with the same configuration - everything works correctly.

Since you are using Spring Boot 2 you need additional dependency as described https://github.com/zalando/logbook#spring-5--spring-boot-2-support

@MaksimMyshkin thanks for the answer, I realized that I made a mistake in the dependencies - instead of
implementation "org.zalando:logbook-servlet:3.0.0:javax"
I specified
implementation "org.zalando:logbook-servlet:3.0.0"

I'll close the issue as resolved.