Skip to content

Commit

Permalink
Add logging filter for Reactor Netty HTTP client
Browse files Browse the repository at this point in the history
#deploy-proxy-yrkesskade

Configured application.yml to set logging levels for Reactor Netty and Spring Cloud Gateway. Created a new LogFilter configuration class to add wiretap logging for HTTP client at INFO level.
  • Loading branch information
krharum committed Oct 7, 2024
1 parent 2f0b118 commit 4e2b90f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package no.nav.testnav.proxies.yrkesskadeproxy.config;

import io.netty.handler.logging.LogLevel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import reactor.netty.http.client.HttpClient;
import reactor.netty.transport.logging.AdvancedByteBufFormat;

@Configuration
public class LogFilter {

@Bean
HttpClient httpClient() {
return HttpClient.create().wiretap("LoggingFilter",
LogLevel.INFO, AdvancedByteBufFormat.TEXTUAL);
}
}
9 changes: 9 additions & 0 deletions proxies/yrkesskade-proxy/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ server:
error:
include-message: always

logging:
level:
reactor:
netty: INFO
org:
springframework:
cloud:
gateway: INFO

consumers:
yrkesskade:
url: http://yrkesskade-datagenerator-service.yrkesskade.svc.cluster.local
Expand Down

0 comments on commit 4e2b90f

Please sign in to comment.