Class Log4jConfigurator


  • public class Log4jConfigurator
    extends Object
    Configurator used to configure a log4j repository dynamically.
    Author:
    schwabmar
    • Method Detail

      • getInstance

        public static Log4jConfigurator getInstance()
        Gets the one-and-only instance of the class Log4jConfigurator.
        Returns:
        Instance.
      • getLoggers

        public List<String> getLoggers()
        Retrieves all loggers from the log4j repository.
        Returns:
        List of java.lang.String containing all logger names.
      • getLoggersSorted

        public List<String> getLoggersSorted()
        Retrieves all loggers from the log4j repository.
        Returns:
        Sorted list of java.lang.String containing all logger names.
      • getLevel

        public org.apache.logging.log4j.Level getLevel​(String logger)
                                                throws IllegalArgumentException
        Gets a logger's actual level.
        Parameters:
        logger - The logger.
        Returns:
        The logger's level or null if no level was directly set on the logger.
        Throws:
        IllegalArgumentException - In case the logger isn't known.
      • getEffectiveLevel

        public org.apache.logging.log4j.Level getEffectiveLevel​(String logger)
                                                         throws IllegalArgumentException
        Gets a logger's effective level thus either the direct level or the inherited level from it's parent logger.
        Parameters:
        logger - The logger.
        Returns:
        The logger's effective level.
        Throws:
        IllegalArgumentException - In case the logger isn't known.