I am using CommonsRequestLoggingFilter to log payload of incoming request . But for one method i don't want to log the payload as it contains user confidential data . I have following configuration in web.xml
<filter>
<filter-name>LogFilter</filter-name>
<filter-class>org.springframework.web.filter.CommonsRequestLoggingFilter</filter-class>
<init-param>
<param-name>includePayload</param-name>
<param-value >true</param-value>
</init-param>
<init-param>
<param-name>includeQueryString</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>MaxPayloadLength</param-name>
<param-value>10000</param-value>
</init-param>
</filter>
Help me in restricting with one method .
Thanks in advance
You could create your own class extending CommonsRequestLoggingFilter and in that class you could do:-
@Override
protected String createMessage(HttpServletRequest request, String prefix, String suffix) {
//based on uri you could print payload or not.
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With