wt.log4j
Class LogR

java.lang.Object
  extended by wt.log4j.LogR

public final class LogR
extends Object

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
static Logger getLogger(String loggerName)
          This method should be used to acquire Logger objects from log4j rather than directly calling Logger.getLogger().
static LoggerRepository getLoggerRepository()
          This method should be used to acquire LoggerRepository objects from log4j rather than directly calling LogManager.getLoggerRepository().
static void initProperties()
          This should be called to initialize various system properties for convenient use for log4j configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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

public static Logger getLogger(String loggerName)
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


getLoggerRepository

public static LoggerRepository getLoggerRepository()
This method should be used to acquire LoggerRepository objects from log4j rather than directly calling LogManager.getLoggerRepository(). Using this method provides an opportunity to ensure that we get the appropriate LoggerRepository as log4j's RepositorySelector mechanism can be a bit finicky.

Supported API: true