Class LoggerEx.Builder

java.lang.Object
com.inductiveautomation.ignition.common.util.LoggerEx.Builder
Enclosing class:
LoggerEx

public static class LoggerEx.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • identObject

      public LoggerEx.Builder identObject(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(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(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(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(Class<?> loggerClass)
    • build

      public LoggerEx build(String loggerName)
    • build

      public LoggerEx build(String parentName, String thisName)
      Convenience function for building child loggers