Class HeaderMdcFilter

  • All Implemented Interfaces:
    io.micronaut.core.order.Ordered, io.micronaut.http.filter.HttpFilter, io.micronaut.http.filter.HttpServerFilter

    @Refreshable
    @Requires(property="logger.http.header.enabled",notEquals="false") @Requires(property="logger.http.header.names")
    @Filter("${logger.http.header.path:/**}")
    public class HeaderMdcFilter
    extends AbstractMdcFilter
    Filter to add http headers to MDC.
    Author:
    Stephan Schnabel
    • Constructor Detail

      • HeaderMdcFilter

        public HeaderMdcFilter​(@Value("${logger.http.header.names}")
                               List<String> headers,
                               @Value("${logger.http.header.prefix}")
                               Optional<String> prefix,
                               @Value("${logger.http.header.order}")
                               Optional<Integer> order)
    • Method Detail

      • doFilter

        public org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>> doFilter​(io.micronaut.http.HttpRequest<?> request,
                                                                                                io.micronaut.http.filter.ServerFilterChain chain)