Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logbook not working with Spring Boot 3.3.x + Webflux #1926

Open
karolhor opened this issue Oct 1, 2024 · 0 comments
Open

Logbook not working with Spring Boot 3.3.x + Webflux #1926

karolhor opened this issue Oct 1, 2024 · 0 comments
Labels

Comments

@karolhor
Copy link

karolhor commented Oct 1, 2024

Logbook does not work with Spring Boot 3.3.4 with webflux/netty dependencies.

Description

I'm trying to integrate logbook with Spring Boot 3.3.x + webflux but it seems not to log requests/responses. I read the documentation and tried to find some working examples on the web, but without success.

Before that I worked with Spring Boot 2.7.x and Logbook 3.7.2, which worked as a charm.
I've prepared a minimal repo with two versions of Spring Boot for testing to reproduce this issue.

Steps to Reproduce

  1. Clone repo https://github.com/karolhor/webflux-logbook-example
  2. Run application for Spring Boot 3.3.x: mvn spring-boot:run
  3. Open page in your browser: http://localhost:8080/api/example
  4. Check the logs - there is no request/response data
Screenshot 2024-10-02 at 01 31 09
  1. Run application for Spring Boot 2.6.x: mvn -f pom-2.6.xml spring-boot:run
  2. Open page in your browser: http://localhost:8080/api/example
  3. Check the logs - correct behaviour
Screenshot 2024-10-02 at 01 49 22

Your Environment

pom.xml
pom-2.6.xml

...
<properties>
  ...
  <logbook.version>3.9.0</logbook.version>
</properties>

<dependencyManagement>
  <dependencies>
    ...
    <dependency>
      <groupId>org.zalando</groupId>
      <artifactId>logbook-bom</artifactId>
      <version>${logbook.version}</version>
      <type>pom</type>
      <scope>import</scope>
      </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
  </dependency>
  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-webflux</artifactId>
  </dependency>
  <dependency>
    <groupId>org.zalando</groupId>
    <artifactId>logbook-spring-boot-webflux-autoconfigure</artifactId>
  </dependency>
  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-test</artifactId>
    <scope>test</scope>
  </dependency>
  <dependency>
    <groupId>io.projectreactor</groupId>
    <artifactId>reactor-test</artifactId>
    <scope>test</scope>
  </dependency>
</dependencies>
...
Screenshot 2024-10-02 at 01 52 15

application.yml

logging.level:
  com.github.karolhor: TRACE
  org.zalando.logbook: TRACE

logbook:
  write:
    max-body-size: 10000
  obfuscate:
    replacement: "*****"
    headers:
      - Authorization
  format:
    style: http
@karolhor karolhor added the Bug label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant