public class LoggingContextAccessor extends Object
The logging context is injected into log messages emitted via standard logging APIs. This enables grouping logs based on the execution context of the place where log message was emitted and searching messages on the logs processing back-end.
Constructor and Description |
---|
LoggingContextAccessor() |
Modifier and Type | Method and Description |
---|---|
static LoggingContext |
getLoggingContext() |
static void |
setLoggingContext(LoggingContext context)
Sets the logging context.
|
public static void setLoggingContext(LoggingContext context)
NOTE: in work execution frameworks where threads are shared between workers (like Akka) we would have to init context very frequently (before every chunk of work is started). In that case we really want to re-use logging context object instance.
context
- context to setpublic static LoggingContext getLoggingContext()
Copyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.