Package org.javalite.logging
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 Summary
Constructors Constructor Description Context()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclear()Clears current context of any values.static voidput(String... namesAndValues)Add multiple values in a classical JavaLite style.static StringtoJSON()
-
-
-
Method Detail
-
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, ornullif no values were set.
-
-