Class Context

java.lang.Object
org.javalite.logging.Context

public class Context extends Object
Serves mostly to pass name and values from any code down to the logging system to be included on every log line by a current thread.. till cleared.
Author:
igor on 2/5/17.
  • Constructor Details

    • Context

      public Context()
  • Method Details

    • put

      public static void put(String... namesAndValues)
      Add multiple values in a classical JavaLite style.
      Parameters:
      namesAndValues - names and values (must pass even number).
    • clear

      public static void clear()
      Clears current context of any values. Usually this is called at the end of a web request or the end of some processing unit.
    • toJSON

      public static String toJSON()
      Returns:
      JSON representation of context. Expect a JSON object "{...}" if values are present, or null if no values were set.