micronaut-logging/docs/features/http_mdc_path.md

930 B

Add HTTP path parts to MDC

Properties

Property Description Default
logger.http.path.enabled filter enabled? true
logger.http.path.path filter path /**
logger.http.path.order order for Ordered ServerFilterPhase.FIRST.before()
logger.http.path.prefix prefix to MDC key ``
logger.http.path.patterns patterns with groups to add to MDC []

Examples

Configuration for adding ids:

logger:
  http:
    path:
      prefix: path.
      patterns:
        - \/gateway\/(?<gatewayId>[a-f0-9\-]{36})
        - \/gateway\/(?<gatewayId>[a-f0-9\-]{36})\/configuration\/(?<config>[a-z]+)