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.ScopeDecorator
create()
Deprecated.since 5.11 useget()
ornewBuilder()
static CurrentTraceContext.ScopeDecorator
get()
Returns a singleton that configuresBaggageFields.TRACE_ID
andBaggageFields.SPAN_ID
.static CorrelationScopeDecorator.Builder
newBuilder()
Returns a builder that configuresBaggageFields.TRACE_ID
andBaggageFields.SPAN_ID
.
-
Constructor Details
-
ThreadContextScopeDecorator
public ThreadContextScopeDecorator()
-
-
Method Details
-
get
Returns a singleton that configuresBaggageFields.TRACE_ID
andBaggageFields.SPAN_ID
.- Since:
- 5.11
-
newBuilder
Returns a builder that configuresBaggageFields.TRACE_ID
andBaggageFields.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_ID
andBaggageFields.SAMPLED
- Since:
- 5.2
-