I appreciate your video as always. I’ve been doing Spring for many years. Having stepped away from it for a couple weeks now, I must say, it never stops to surprise me just how much error-prone hassle it imposes on you for something so simple, it doesn’t make me feel like one can be agile or simply productive with Spring 😅 and I tend to forget about that when I get back to the Spring ecosystem, debugging production code. You never stop learning with Spring.😅
It shouldn't be so complicated to do something so commonly needed!!! Fortunately, instead of RestClient I am using Apache Camel in my project. Logging (and almost everything) is incredibly much simpler.
I have done something very similar. Could you also do a bit on server request logging. From basic common log format to detailed body logging. Both with tomcat and jetty
Hi Dan, how about configuring the RestClient requestFactory with the below .requestFactory(new BufferingClientHttpRequestFactory(new SimpleClientHttpRequestFactory())) full bean definition is below @Bean RestClient demoServiceRestClientConfigurer( RestClient.Builder restClientBuilder, AppProperties.ExternalSystem demoSystemProperties, RestClientInterceptor demoRestClientInterceptor) { return restClientBuilder .baseUrl(demoSystemProperties.getBaseUrl()) .requestFactory(new BufferingClientHttpRequestFactory(new SimpleClientHttpRequestFactory())) .requestInterceptor(demoRestClientInterceptor) .build(); }
I appreciate your video as always. I’ve been doing Spring for many years. Having stepped away from it for a couple weeks now, I must say, it never stops to surprise me just how much error-prone hassle it imposes on you for something so simple, it doesn’t make me feel like one can be agile or simply productive with Spring 😅 and I tend to forget about that when I get back to the Spring ecosystem, debugging production code. You never stop learning with Spring.😅
Nice! Thanks for sharing, Dan!
Great stuff!
What about a websocket example with Spring?
Really helpful , thanks Dan
It shouldn't be so complicated to do something so commonly needed!!!
Fortunately, instead of RestClient I am using Apache Camel in my project. Logging (and almost everything) is incredibly much simpler.
Very Nice!
Dan answering questions from Dan
Nice
Seems like a pretty heavy approach just to get a log! Lots of buffers and reading stuff. Error prone.
Great video!
Thank you, do you know which use cases can be acomplished with this example, please 😅
wtf, Dan, i literally was thinking about loggig, like i need change my print to log in my pet project and here we go
I have done something very similar. Could you also do a bit on server request logging. From basic common log format to detailed body logging. Both with tomcat and jetty
I always wondered why the framework doesn't provide an implementation of the interceptor (logging interceptor) that one could just use out of the box?
For spring webflux(webclient)?
Hi Dan,
how about configuring the RestClient requestFactory with the below
.requestFactory(new BufferingClientHttpRequestFactory(new SimpleClientHttpRequestFactory()))
full bean definition is below
@Bean
RestClient demoServiceRestClientConfigurer(
RestClient.Builder restClientBuilder,
AppProperties.ExternalSystem demoSystemProperties,
RestClientInterceptor demoRestClientInterceptor) {
return restClientBuilder
.baseUrl(demoSystemProperties.getBaseUrl())
.requestFactory(new BufferingClientHttpRequestFactory(new SimpleClientHttpRequestFactory()))
.requestInterceptor(demoRestClientInterceptor)
.build();
}