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 Summary
Fields Modifier and Type Field Description static StringHOSTING_SERVICE_INFOThe key which is used in the thread context to communicate the hosting service info.
-
Constructor Summary
Constructors Constructor Description HostingServiceLogger()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.logging.log4j.LoggergetLogger(org.apache.logging.log4j.Logger logger, HostingServiceProxy hostingService, String frameworkIdentifier)Gets a logger.
-
-
-
Field Detail
-
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:
- Constant Field Values
-
-
Method Detail
-
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 wraphostingService- the hosting service information that is added to log messagesframeworkIdentifier- identifier of the current framework instance- Returns:
- a child logger adapter that contains instance and hosting service information in the log context
-
-