Class HostingServiceLogger

java.lang.Object
org.somda.sdc.glue.consumer.helper.HostingServiceLogger

public class HostingServiceLogger extends Object
Logger which adds instance and hosting service specific information to every log message using the CloseableThreadContext.
  • Field Details

    • HOSTING_SERVICE_INFO

      public static final String HOSTING_SERVICE_INFO
      The key which is used in the thread context to communicate the hosting service info.
      See Also:
  • Constructor Details

    • HostingServiceLogger

      public HostingServiceLogger()
  • Method Details

    • getLogger

      public static org.apache.logging.log4j.Logger getLogger(org.apache.logging.log4j.Logger logger, HostingServiceProxy hostingService, String frameworkIdentifier)
      Gets a logger.

      Use this function as a replacement for LogManager.getLogger(Class).

      Parameters:
      logger - logger to wrap
      hostingService - the hosting service information that is added to log messages
      frameworkIdentifier - identifier of the current framework instance
      Returns:
      a child logger adapter that contains instance and hosting service information in the log context