Spring Boot Interceptors
A neat trick to log HTTP requests and responses in a Spring Boot project is through interceptors. To log requests and responses between the client and the server, I use the HandlerInterceptor (Introduction to Spring MVC HandlerInterceptor).
To create this interceptor, simply extend the HandlerInterceptor interface. By overriding the various methods available, you can intercept the request and/or response at different points of time. For example, preHandle is executed before the request is executed (i.
Continue reading "Spring Boot Interceptors"