/** * A filter used capture the request body */ @Bean public static Filter requestLoggingFilter() { final CommonsRequestLoggingFilter loggingFilter = new CommonsRequestLoggingFilter(); loggingFilter.setIncludePayload(true); loggingFilter.setMaxPayloadLength(512); return loggingFilter; }
public CommonsRequestLoggingFilter requestLoggingFilter() { CommonsRequestLoggingFilter loggingFilter = new CommonsRequestLoggingFilter(); loggingFilter.setIncludeClientInfo(properties.client); loggingFilter.setIncludeQueryString(properties.query); loggingFilter.setIncludePayload(properties.payload); loggingFilter.setIncludeHeaders(properties.headers); return loggingFilter; }
@Bean @ConditionalOnClass(Logger.class) public CommonsRequestLoggingFilter springLogging() { Logger logger = (Logger) LoggerFactory.getLogger(CommonsRequestLoggingFilter.class); logger.setLevel(Level.DEBUG); log.info("Http logging enabled {}.", properties); return requestLoggingFilter(); }
@Bean public CommonsRequestLoggingFilter logFilter() { CommonsRequestLoggingFilter filter = new CommonsRequestLoggingFilter(); filter.setIncludeQueryString(true); filter.setIncludePayload(true); filter.setMaxPayloadLength(10000); filter.setIncludeHeaders(false); filter.setAfterMessagePrefix("REQUEST DATA : "); return filter; }
@Bean public FilterRegistrationBean commonsRequestLoggingFilter() { FilterRegistrationBean registration = new FilterRegistrationBean(); registration.setName("requestLoggingFilter"); registration.setDispatcherTypes(DispatcherType.REQUEST); registration.setFilter(new CommonsRequestLoggingFilter()); registration.addUrlPatterns("/**"); registration.setOrder(Integer.MAX_VALUE); return registration; }
/** * set property logging.level.org.springframework.web.filter=DEBUG * for logging output * @return */ @Bean public CommonsRequestLoggingFilter logFilter() { CommonsRequestLoggingFilter filter = new CommonsRequestLoggingFilter(); filter.setIncludeQueryString(true); filter.setIncludePayload(true); filter.setMaxPayloadLength(10000); filter.setIncludeHeaders(false); filter.setAfterMessagePrefix("REQUEST DATA : "); return filter; }
@Bean public Filter logFilter() { CommonsRequestLoggingFilter filter = new CommonsRequestLoggingFilter(); filter.setIncludeClientInfo(true); filter.setIncludeQueryString(true); filter.setIncludePayload(true); filter.setMaxPayloadLength(5120); return new ExclusionFilter(filter, "/resources/.*", "/health/?.*"); }
@Bean public Filter logFilter() { CommonsRequestLoggingFilter filter = new CommonsRequestLoggingFilter(); filter.setIncludeClientInfo(true); filter.setIncludeQueryString(true); filter.setIncludePayload(true); filter.setMaxPayloadLength(5120); return new ExclusionFilter(filter, "/(resources|images|js|css|public)/.*", "/health/?.*"); }
@Bean public Filter logFilter() { // TODO: Extract bean-def to Util-component! CommonsRequestLoggingFilter filter = new CommonsRequestLoggingFilter(); filter.setIncludeQueryString(true); filter.setIncludePayload(true); filter.setMaxPayloadLength(5120); return filter; }
private void addLoggingFilter(ServletContext container) { FilterRegistration.Dynamic fr = container.addFilter("loggingFilter", new CommonsRequestLoggingFilter()); fr.addMappingForUrlPatterns(null, true, "/*"); }