Add this to the class representing the configuration for the application:
import javax.servlet.Filter;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.filter.AbstractRequestLoggingFilter;
....
@Bean
public Filter loggingFilter(){
AbstractRequestLoggingFilter f = new AbstractRequestLoggingFilter() {
@Override
protected void beforeRequest(HttpServletRequest request, String message) {
System.out.println("beforeRequest: " +message);
}
@Override
protected void afterRequest(HttpServletRequest request, String message) {
System.out.println("afterRequest: " +message);
}
};
f.setIncludeClientInfo(true);
f.setIncludePayload(true);
f.setIncludeQueryString(true);
f.setBeforeMessagePrefix("BEFORE REQUEST [");
f.setAfterMessagePrefix("AFTER REQUEST [");
f.setAfterMessageSuffix("]
");
return f;
}
you may have to comment out
f.setIncludePayload(true);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…