Skip to content

Instantly share code, notes, and snippets.

@fitzoh
Created February 10, 2018 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitzoh/64c463d4573a691d5fda20458321ee8e to your computer and use it in GitHub Desktop.
Save fitzoh/64c463d4573a691d5fda20458321ee8e to your computer and use it in GitHub Desktop.
@Component
public class SimpleLoggingFilter implements GatewayFilter {
private static final Logger log = LoggerFactory.getLogger(SimpleLoggingFilter.class);
@Override
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
log.info("Method:{} Host:{} Path:{} QueryParams:{}",
exchange.getRequest().getMethod(),
exchange.getRequest().getURI().getHost(),
exchange.getRequest().getURI().getPath(),
exchange.getRequest().getQueryParams());
return chain.filter(exchange);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment