Class KibanaLogFields
- java.lang.Object
-
- org.hawaiiframework.logging.model.KibanaLogFields
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static KibanaLogField
callResult(KibanaLogCallResultTypes value)
Set the field KibanaLogTypeNames.LOG_TYPE to the givenvalue
.static void
clear()
Removes all values set for all fields.static String
get(KibanaLogField field)
Retrieves the value for thefield
.static KibanaLogContext
getContext()
Create a new log context for the current thread's kibana log fields.static String
getOrDefault(KibanaLogField field, String defaultValue)
Retrieves the value for thefield
.static String
getValuesAsLogString()
Getter for the log string.static AutoCloseableKibanaLogField
logType(KibanaLogTypeNames value)
Set the field KibanaLogTypeNames.LOG_TYPE to the givenvalue
.static void
populateFromContext(KibanaLogContext logContext)
Update log fields based on theKibanaLogContext
.static KibanaLogField
set(KibanaLogField field, int value)
Sets the Kibana log fieldfield
to thevalue
.static KibanaLogField
set(KibanaLogField field, String value)
Sets the Kibana log fieldfield
to thevalue
.static KibanaLogField
tag(KibanaLogField field, String value)
Sets the Kibana log fieldfield
to thevalue
.static AutoCloseableKibanaLogField
tagCloseable(KibanaLogField field, String value)
Sets the Kibana log fieldfield
to thevalue
, returns an auto closeable.static void
unset(KibanaLogField field)
Removes the value for the fieldfield
.static void
unsetLogType()
Removes the value for the field KibanaLogTypeNames.LOG_TYPE.
-
-
-
Method Detail
-
logType
public static AutoCloseableKibanaLogField logType(KibanaLogTypeNames value)
Set the field KibanaLogTypeNames.LOG_TYPE to the givenvalue
.
-
callResult
public static KibanaLogField callResult(KibanaLogCallResultTypes value)
Set the field KibanaLogTypeNames.LOG_TYPE to the givenvalue
.
-
unsetLogType
public static void unsetLogType()
Removes the value for the field KibanaLogTypeNames.LOG_TYPE.
-
set
public static KibanaLogField set(KibanaLogField field, int value)
Sets the Kibana log fieldfield
to thevalue
.
-
set
public static KibanaLogField set(KibanaLogField field, String value)
Sets the Kibana log fieldfield
to thevalue
.
-
tag
public static KibanaLogField tag(KibanaLogField field, String value)
Sets the Kibana log fieldfield
to thevalue
.
-
tagCloseable
public static AutoCloseableKibanaLogField tagCloseable(KibanaLogField field, String value)
Sets the Kibana log fieldfield
to thevalue
, returns an auto closeable.
-
get
public static String get(KibanaLogField field)
Retrieves the value for thefield
. It will returnnull
if no value is set.
-
getOrDefault
public static String getOrDefault(KibanaLogField field, String defaultValue)
Retrieves the value for thefield
. It will returndefaultValue
if no value is set.
-
unset
public static void unset(KibanaLogField field)
Removes the value for the fieldfield
.
-
clear
public static void clear()
Removes all values set for all fields.
-
getValuesAsLogString
public static String getValuesAsLogString()
Getter for the log string.- Returns:
- the log string
-
populateFromContext
public static void populateFromContext(KibanaLogContext logContext)
Update log fields based on theKibanaLogContext
.See
getContext()
.
-
getContext
public static KibanaLogContext getContext()
Create a new log context for the current thread's kibana log fields.
-
-