Package wt.log4j
Class LogR
java.lang.Object
wt.log4j.LogR
Short for LoggerRepository this class helps ensure that the appropriate
log4j LoggerRepository is used and should be used in place of log4j's
Logger.getLogger() and LogManager.getLoggerRepository() APIs.
Internally, this class works in conjunction with Log4jRepositySelector.
Note that for any of this to work properly, a separate copy of this class
must be loaded by each context (e.g. web application) that is to have a
separate LoggerRepository.
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.logging.log4j.LoggerThis method should be used to acquire Logger objects from log4j rather than directly calling Logger.getLogger().static org.apache.logging.log4j.LoggergetLoggerInternal(String loggerName) This method should be used to acquire Logger objects from log4j rather than directly calling Logger.getLogger().static voidThis should be called to initialize various system properties for convenient use for log4j configuration.
-
Method Details
-
initProperties
public static void initProperties()This should be called to initialize various system properties for convenient use for log4j configuration.This should be called before there is any chance of log4j initially reading its configuration file if you wish to allow use of these properties in that configuration file (which is the point after all). This is already handled for method server, server manager, and Windchill web app cases.
Supported API: true -
getLogger
This method should be used to acquire Logger objects from log4j rather than directly calling Logger.getLogger(). Using this method provides an opportunity to ensure that we use the appropriate LoggerRepository.
Supported API: true -
getLoggerInternal
This method should be used to acquire Logger objects from log4j rather than directly calling Logger.getLogger(). Using this method provides an opportunity to ensure that we use the appropriate LoggerRepository.
Supported API: true
-