object LoggingContextWithTrace
- Alphabetic
- By Inheritance
- LoggingContextWithTrace
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val ForTesting: LoggingContextWithTrace
- def apply(loggerFactory: NamedLoggerFactory, telemetry: Telemetry): LoggingContextWithTrace
- def apply(loggerFactory: NamedLoggerFactory)(implicit traceContext: TraceContext): LoggingContextWithTrace
- def apply(traceContext: TraceContext)(implicit loggingContext: LoggingContext): LoggingContextWithTrace
- def apply(telemetry: Telemetry)(implicit loggingContext: LoggingContext): LoggingContextWithTrace
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- val empty: LoggingContextWithTrace
- def enriched[A](entry: LoggingEntry, entries: LoggingEntry*)(implicit loggingContextWithTrace: LoggingContextWithTrace): LoggingContextWithTrace
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- implicit def implicitExtractTraceContext(implicit source: LoggingContextWithTrace): TraceContext
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def withEnrichedLoggingContext[A](entry: LoggingEntry, entries: LoggingEntry*)(f: (LoggingContextWithTrace) => A)(implicit loggingContextWithTrace: LoggingContextWithTrace): A
- def withEnrichedLoggingContext[A](telemetry: Telemetry)(entry: LoggingEntry, entries: LoggingEntry*)(f: (LoggingContextWithTrace) => A)(implicit loggingContext: LoggingContext): A
## Principles to follow when enriching the logging context
## Principles to follow when enriching the logging context
### Don't add values coming from a scope outside of the current method
If a method receives a value as a parameter, it should trust that, if it was relevant, the caller already added this value to the context. Add values to the context as upstream as possible in the call chain. This ensures to not add duplicates, possibly using slightly different names to track the same value. The context was implemented to ensure that values did not have to be passed down the entire call stack to be logged at relevant points.
### Don't dump string representations of complex objects
The purpose of the context is to be consumed by structured logging frameworks. Dumping the string representation of an object, like a Scala case class instance, means embedding some form of string formatting in another (likely to be JSON). This can be difficult to manage and parse, so stick to simple values (strings, numbers, dates, etc.).
- def withNewLoggingContext[A](entries: LoggingEntry*)(f: (LoggingContextWithTrace) => A)(implicit traceContext: TraceContext): A