Class LoggingCategoryNames


  • public class LoggingCategoryNames
    extends Object
    Provides mapping from class names to simple category names used for logging.

    Given a classname, eg org.forgerock.opendj.server.core.SomeClass, it allows to get the corresponding simplified category name if it exists, eg "CORE". If no simplified category name exist, the classname is used as a category name.

    • Constructor Detail

      • LoggingCategoryNames

        public LoggingCategoryNames()
    • Method Detail

      • getCategoryName

        public static String getCategoryName​(String className)
        Returns the simple category name corresponding to the provided class name or the class name if no mapping corresponds.
        Parameters:
        className - The classname to retrieve the category name from.
        Returns:
        the simple category name, or the provided className if no matching simple category name is found
      • getCategoryName

        public static String getCategoryName​(String className,
                                             String fallbackCategory)
        Returns the simple category name corresponding to the provided class name or a class name if no mapping corresponds. The returned class name will be fallbackCategory if the class name is null.
        Parameters:
        className - The classname to retrieve the category name from.
        fallbackCategory - The category to return when className is null.
        Returns:
        the simple category name, or the provided className if no matching simple category name is found