Package wt.log4j

Class LogR

java.lang.Object
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

    Modifier and Type
    Method
    Description
    static org.apache.logging.log4j.Logger
    getLogger(String loggerName)
    This method should be used to acquire Logger objects from log4j rather than directly calling Logger.getLogger().
    static org.apache.logging.log4j.Logger
    This method should be used to acquire Logger objects from log4j rather than directly calling Logger.getLogger().
    static void
    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 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

      public static org.apache.logging.log4j.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
    • getLoggerInternal

      public static org.apache.logging.log4j.Logger getLoggerInternal(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