Class HostingServiceLogger
java.lang.Object
org.somda.sdc.glue.consumer.helper.HostingServiceLogger
Logger which adds instance and hosting service specific information to every log message
using the CloseableThreadContext.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe key which is used in the thread context to communicate the hosting service info. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.logging.log4j.LoggergetLogger(org.apache.logging.log4j.Logger logger, HostingServiceProxy hostingService, String frameworkIdentifier) Gets a logger.
-
Field Details
-
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 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
-