Package brave.context.log4j2
Class ThreadContextScopeDecorator
java.lang.Object
brave.context.log4j2.ThreadContextScopeDecorator
public final class ThreadContextScopeDecorator extends Object
Creates a
CorrelationScopeDecorator for Log4j 2 Thread
Context.
Ex.
tracing = Tracing.newBuilder()
.currentTraceContext(ThreadLocalCurrentTraceContext.newBuilder()
.addScopeDecorator(ThreadContextScopeDecorator.get())
.build()
)
...
.build();
- See Also:
CorrelationScopeDecorator
-
Constructor Summary
Constructors Constructor Description ThreadContextScopeDecorator() -
Method Summary
Modifier and Type Method Description static CurrentTraceContext.ScopeDecoratorcreate()Deprecated.since 5.11 useget()ornewBuilder()static CurrentTraceContext.ScopeDecoratorget()Returns a singleton that configuresBaggageFields.TRACE_IDandBaggageFields.SPAN_ID.static CorrelationScopeDecorator.BuildernewBuilder()Returns a builder that configuresBaggageFields.TRACE_IDandBaggageFields.SPAN_ID.
-
Constructor Details
-
ThreadContextScopeDecorator
public ThreadContextScopeDecorator()
-
-
Method Details
-
get
Returns a singleton that configuresBaggageFields.TRACE_IDandBaggageFields.SPAN_ID.- Since:
- 5.11
-
newBuilder
Returns a builder that configuresBaggageFields.TRACE_IDandBaggageFields.SPAN_ID.- Since:
- 5.11
-
create
Deprecated.since 5.11 useget()ornewBuilder()Returns a scope decorator that configuresBaggageFields.TRACE_ID,BaggageFields.PARENT_ID,BaggageFields.SPAN_IDandBaggageFields.SAMPLED- Since:
- 5.2
-