Class MDCInterceptor

java.lang.Object
org.atmosphere.cpr.AtmosphereInterceptorAdapter
org.atmosphere.interceptor.MDCInterceptor
All Implemented Interfaces:
AtmosphereInterceptor, AtmosphereConfigAware, InvokationOrder

public class MDCInterceptor extends AtmosphereInterceptorAdapter
Interceptor that populates the SLF4J MDC with Atmosphere-specific context for structured logging. Values are set on request entry and cleared after processing to avoid leaking into unrelated threads.

MDC keys

  • atmosphere.uuid — the unique resource identifier
  • atmosphere.transport — the transport type (websocket, long-polling, sse, etc.)
  • atmosphere.broadcaster — the broadcaster ID this resource is attached to

Logback pattern example

 %d{HH:mm:ss.SSS} [%thread] %-5level [uuid=%X{atmosphere.uuid} transport=%X{atmosphere.transport}] %logger{36} - %msg%n
 

JSON layout (logback-contrib or logstash-logback-encoder)

MDC keys are automatically included as top-level fields in JSON output.
Since:
4.0