org.apache.logging.log4j.core.config

Interface Configuration

    • Method Detail

      • getName

        String getName()
        Returns the configuration name.
        Returns:
        the name of the configuration.
      • getLoggerConfig

        LoggerConfig getLoggerConfig(String name)
        Locates the appropriate LoggerConfig for a Logger name. This will remove tokens from the package name as necessary or return the root LoggerConfig if no other matches were found.
        Parameters:
        name - The Logger name.
        Returns:
        The located LoggerConfig.
      • getAppender

        <T extends Appender> T getAppender(String name)
        Returns the Appender with the specified name.
        Type Parameters:
        T - The expected Appender type.
        Parameters:
        name - The name of the Appender.
        Returns:
        the Appender with the specified name or null if the Appender cannot be located.
      • getAppenders

        Map<String,Appender> getAppenders()
        Returns a Map containing all the Appenders and their name.
        Returns:
        A Map containing each Appender's name and the Appender object.
      • addAppender

        void addAppender(Appender appender)
      • addLoggerAppender

        void addLoggerAppender(Logger logger,
                             Appender appender)
      • addLoggerFilter

        void addLoggerFilter(Logger logger,
                           Filter filter)
      • setLoggerAdditive

        void setLoggerAdditive(Logger logger,
                             boolean additive)
      • removeLogger

        void removeLogger(String name)
      • getPluginPackages

        List<String> getPluginPackages()
        Returns the list of packages to scan for plugins for this Configuration.
        Returns:
        the list of plugin packages.
        Since:
        2.1
      • getRootLogger

        LoggerConfig getRootLogger()
        Returns the root Logger.
        Returns:
        the root Logger.
      • createConfiguration

        void createConfiguration(Node node,
                               LogEvent event)
      • getComponent

        <T> T getComponent(String name)
      • addComponent

        void addComponent(String name,
                        Object object)
      • setAdvertiser

        void setAdvertiser(Advertiser advertiser)
      • isShutdownHookEnabled

        boolean isShutdownHookEnabled()
      • getShutdownTimeoutMillis

        long getShutdownTimeoutMillis()
      • getConfigurationSource

        ConfigurationSource getConfigurationSource()
        Returns the source of this configuration.
        Returns:
        the source of this configuration
      • getCustomLevels

        List<CustomLevelConfig> getCustomLevels()

        Returns a list of descriptors of the custom levels defined in the current configuration. The returned list does not include custom levels that are defined in code with direct calls to Level.forName(String, int).

        Note that the list does not include levels of previous configurations. For example, suppose a configuration contains custom levels A, B and C. The configuration is then modified to contain custom levels B, C and D. For the new configuration, this method will return only {B, C, D}, that is, only the custom levels defined in this configuration. The previously defined level A still exists (and can be obtained with Level.getLevel(String)), it is just not in the current configuration. Level.values() will return {A, B, C, D and the built-in levels}.

        Returns:
        the custom levels defined in the current configuration
      • getAsyncLoggerConfigDelegate

        AsyncLoggerConfigDelegate getAsyncLoggerConfigDelegate()
        Returns the AsyncLoggerConfigDelegate shared by all AsyncLoggerConfig instances defined in this Configuration.
        Returns:
        the AsyncLoggerConfigDelegate
      • getWatchManager

        WatchManager getWatchManager()
        Return the WatchManager.
        Returns:
        the WatchManager.
      • getNanoClock

        NanoClock getNanoClock()
        Returns the NanoClock instance for this configuration.
        Returns:
        the nano clock
      • setNanoClock

        void setNanoClock(NanoClock nanoClock)
        Sets the NanoClock instance for this configuration.
        Parameters:
        nanoClock - the new nano clock for this configuration. Must be non-null.
      • getLoggerContext

        LoggerContext getLoggerContext()
        Gets the logger context.
        Returns:
        the logger context.

Copyright © 1999-2018 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.