Package lumis.util.log
Class MDCUtil
- java.lang.Object
-
- lumis.util.log.MDCUtil
-
public class MDCUtil extends Object
Helper class for MDC manipulation.- Since:
- 9.0.0
- Version:
- $Revision: 19136 $ $Date: 2016-06-02 18:14:45 -0300 (Thu, 02 Jun 2016) $
-
-
Constructor Summary
Constructors Constructor Description MDCUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
clear()
Clears current MDC context.static <T> T
execWithValues(String key, Object value, Callable<T> code)
Executes the given code with the given value in MDC.static void
execWithValues(Map<String,Object> values, Runnable code)
Executes the given code with the given values in MDC.static <T> T
execWithValues(Map<String,Object> values, Callable<T> code)
Executes the given code with the given values in MDC.
-
-
-
Method Detail
-
execWithValues
public static void execWithValues(Map<String,Object> values, Runnable code)
Executes the given code with the given values in MDC.- Parameters:
values
- the values.code
- the code.- Since:
- 9.0.0
-
execWithValues
public static <T> T execWithValues(String key, Object value, Callable<T> code)
Executes the given code with the given value in MDC.- Parameters:
key
- the value key.value
- the value.code
- the code.- Returns:
- the code execution return.
- Since:
- 9.0.0
-
execWithValues
public static <T> T execWithValues(Map<String,Object> values, Callable<T> code)
Executes the given code with the given values in MDC.- Parameters:
values
- the values.code
- the code.- Returns:
- the code execution return.
- Since:
- 9.0.0
-
clear
public static void clear()
Clears current MDC context.- Since:
- 9.0.0
-
-