Class ContextHandler

java.lang.Object
com.google.cloud.logging.ContextHandler

public class ContextHandler extends Object
Class provides a per-thread storage of the instances.
  • Constructor Details

    • ContextHandler

      public ContextHandler()
  • Method Details

    • getCurrentContext

      public Context getCurrentContext()
    • setCurrentContext

      public void setCurrentContext(Context context)
    • getCurrentContextPriority

      public ContextHandler.ContextPriority getCurrentContextPriority()
    • setCurrentContext

      public void setCurrentContext(Context context, ContextHandler.ContextPriority priority)
      Sets the context based on the priority. Overrides traceId, spanId and TraceSampled if the passed priority is higher. HttpRequest values will be retrieved and combined from existing context if HttpRequest in the new context is empty .
    • removeCurrentContext

      public void removeCurrentContext()
    • removeCurrentContextPriority

      public void removeCurrentContextPriority()