Class LoggerEx.Builder
- java.lang.Object
-
- com.inductiveautomation.ignition.common.util.LoggerEx.Builder
-
- Enclosing class:
- LoggerEx
public static class LoggerEx.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LoggerEx
build(java.lang.Class<?> loggerClass)
LoggerEx
build(java.lang.String loggerName)
LoggerEx
build(java.lang.String parentName, java.lang.String thisName)
Convenience function for building child loggersLoggerEx.Builder
eventSystem(java.lang.String systemId)
Sets the System Id, which is used by the event logging functions to mark which system the events belong to.LoggerEx.Builder
identObject(java.lang.Object identObj)
Adds a static identity object.LoggerEx.Builder
mdcContext(java.lang.Object... keyValues)
Adds values to the static mdc context.LoggerEx.Builder
mutableIdentObject(java.lang.Object identObj)
Adds an identity object that will be calculated for each log message.
-
-
-
Method Detail
-
identObject
public LoggerEx.Builder identObject(java.lang.Object identObj)
Adds a static identity object. If the underlying identObject can change, use mutableIdentObject. Identity objects are strings that get pre-pended to logged messages.
-
mutableIdentObject
public LoggerEx.Builder mutableIdentObject(java.lang.Object identObj)
Adds an identity object that will be calculated for each log message. Identity objects are strings that get pre-pended to logged messages.
-
mdcContext
public LoggerEx.Builder mdcContext(java.lang.Object... keyValues)
Adds values to the static mdc context. The provided values, which are expected to be key/value pairs, will be set and unset on mdc around each logging operation. They are specified as objects, so that the toString value can be modified dynamically by the underlying object, if desired. NOTE: The key value should be static.
-
eventSystem
public LoggerEx.Builder eventSystem(java.lang.String systemId)
Sets the System Id, which is used by the event logging functions to mark which system the events belong to. This results in a marker being stored for messages logged through the [level]Event() functions.The primary goal of events is to provide a way to log certain messages that might be useful to see apart from other messages of the same level, potentially in combination with other systems. For example, there are events for system startup and shutdown, which are useful to see in combination with other systems, without seeing all of the general system info messages as well. There will often be a fine line between the use of events and MDC values, however, a good guide is that if there might be different values for the concept, such as different profile names, session ids, etc, then MDC should be used.
-
build
public LoggerEx build(java.lang.Class<?> loggerClass)
-
build
public LoggerEx build(java.lang.String loggerName)
-
build
public LoggerEx build(java.lang.String parentName, java.lang.String thisName)
Convenience function for building child loggers
-
-