Class InstanceLogger

java.lang.Object
org.somda.sdc.common.logging.InstanceLogger

public class InstanceLogger extends Object
Logger which adds instance specific information to every log message using the CloseableThreadContext.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The key which is used in the thread context to communicate the instance identifier.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.logging.log4j.Logger
    wrapLogger(org.apache.logging.log4j.Logger logger, String instanceId)
    Wraps a logger into a proxy which adds context information to all messages.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • InstanceLogger

      public InstanceLogger()
  • Method Details

    • wrapLogger

      public static org.apache.logging.log4j.Logger wrapLogger(org.apache.logging.log4j.Logger logger, String instanceId)
      Wraps a logger into a proxy which adds context information to all messages.
      Parameters:
      logger - to wrap
      instanceId - to add to all messages
      Returns:
      wrapped logger instance