Class CategoryUtil

java.lang.Object
org.apache.log4j.legacy.core.CategoryUtil

public final class CategoryUtil extends Object
Delegates to Logger methods implemented by log4j-core if appropriate.
  • Constructor Details

    • CategoryUtil

      private CategoryUtil()
  • Method Details

    • asCore

      private static Logger asCore(Logger logger)
    • get

      private static <T> T get(Logger logger, Supplier<T> run, T defaultValue)
    • getAppenders

      public static Map<String,Appender> getAppenders(Logger logger)
      Delegates to Logger.getAppenders() if appropriate.
      Parameters:
      logger - The target logger.
      Returns:
      A Map containing the Appender's name as the key and the Appender as the value.
    • getFilters

      public static Iterator<Filter> getFilters(Logger logger)
      Delegates to Logger.getFilters() if appropriate.
      Parameters:
      logger - The target logger.
      Returns:
      An Iterator over all the Filters associated with the Logger.
    • getLoggerContext

      public static LoggerContext getLoggerContext(Logger logger)
      Delegates to Logger.getContext() if appropriate.
      Parameters:
      logger - The target logger.
      Returns:
      the LoggerContext.
    • getParent

      public static Logger getParent(Logger logger)
      Delegates to Logger.getParent() if appropriate.
      Parameters:
      logger - The target logger.
      Returns:
      The parent Logger.
    • isAdditive

      public static boolean isAdditive(Logger logger)
      Delegates to Logger.isAdditive() if appropriate.
      Parameters:
      logger - The target logger.
      Returns:
      true if the associated LoggerConfig is additive, false otherwise.
    • isCore

      private static boolean isCore(Logger logger)
    • setAdditivity

      public static void setAdditivity(Logger logger, boolean additive)
      Delegates to Logger.setAdditive(boolean) if appropriate.
      Parameters:
      logger - The target logger.
      additive - Boolean value to indicate whether the Logger is additive or not.
    • setLevel

      public static void setLevel(Logger logger, Level level)
      Delegates to Logger.setLevel(Level) if appropriate.
      Parameters:
      logger - The target logger.
      level - The Level to use on this Logger, may be null.