Class LogManager


  • public class LogManager
    extends Object
    There is one LogManager object in an application. It maintains properties about loggers and manages the hierarchy of loggers.
    • Constructor Detail

      • LogManager

        protected LogManager()
        Protected constructor. There must be only one LogManager in an application.
    • Method Detail

      • getLogManager

        public static LogManager getLogManager()
        Returns the LogManager object.
        Returns:
        the LogManager
      • addLogger

        public boolean addLogger​(Logger logger)
        Add a named logger. This method does nothing if the logger had already been added.

        The factory methods from Logger call this method for each Logger they created.

        Parameters:
        logger - the logger to register
        Returns:
        true if the logger was registered, false if a logger with the same already exists
        Throws:
        NullPointerException - if the logger name is null
      • getLogger

        @Nullable
        public Logger getLogger​(String name)
        Find a named logger.
        Parameters:
        name - name of the logger
        Returns:
        the matching logger or null if there is no match
      • getLoggerNames

        public Enumeration<String> getLoggerNames()
        Get an enumeration of known logger names.
        Returns:
        an enumeration of strings