Logging response body (HTML) from HttpServletResponse using Spring MVC HandlerInterceptorAdapter

后端 未结 5 2127
夕颜
夕颜 2020-12-03 05:11

I am trying to log (just to console write now for simplicity sake) the final rendered HTML that will be returned by the HttpServletResponse. (i.e. the body) To this end, I a

5条回答
  •  醉梦人生
    2020-12-03 05:30

    If you're using (or considering) logback as your logging framework, there is a nice servlet filter already available that does exactly that. Checkout the TeeFilter chapter in the documentation.

提交回复
热议问题