Class Log4jIntegrationConfig


  • public class Log4jIntegrationConfig
    extends Object
    Configuration for log4j over SLF4J.
    Since:
    15.0
    Version:
    17.0 2020-01-04 14:41:57
    Author:
    Stéphane GALLAND
    Maven Group Id:
    org.arakhne.afc.bootique
    Maven Artifact Id:
    bootique-log4j
    • Field Detail

      • USE_LOG4J_CONFIG

        public static final String USE_LOG4J_CONFIG
        Name of the property that indicates if the log4j configuration must be used for initializing the loggers.
        See Also:
        Constant Field Values
      • DEFAULT_LOG_FORMAT

        public static final String DEFAULT_LOG_FORMAT
        Default conversion pattern for the logger.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Log4jIntegrationConfig

        public Log4jIntegrationConfig()
    • Method Detail

      • getConfiguration

        public static Log4jIntegrationConfig getConfiguration​(io.bootique.config.ConfigurationFactory configFactory)
        Replies the configuration factory for the logging.
        Parameters:
        configFactory - the general configuration factory.
        Returns:
        the logging configuration factory.
      • getAppenders

        public List<AppenderConfig> getAppenders()
        Replies the appenders' configurations.
        Returns:
        the appenders' configurations.
      • setAppenders

        public void setAppenders​(List<AppenderConfig> configs)
        Change the appenders' configurations.
        Parameters:
        configs - the appenders' configurations.
      • getLevel

        public Level getLevel()
        Replies the level.
        Returns:
        the level.
      • setLevel

        public void setLevel​(Level level)
        Change the level.
        Parameters:
        level - the level.
      • configureLogger

        public org.apache.log4j.Logger configureLogger​(org.apache.log4j.Logger logger)
        Configure the given logger from the configuration.
        Parameters:
        logger - the logger to configure.
        Returns:
        the logger.
      • configureLogger

        public org.apache.log4j.Logger configureLogger​(String loggerName)
        Configure the given logger from the configuration.
        Parameters:
        loggerName - the name of the logger to configure.
        Returns:
        the logger.
      • getUseLog4jConfig

        public boolean getUseLog4jConfig()
        Replies if the configuration should be used for configuring the Log4j loggers.
        Returns:
        true for using the configuration.
      • setUseLog4jConfig

        public void setUseLog4jConfig​(boolean use)
        Change the flag that indicates if the configuration should be used for configuring the Log4j loggers.
        Parameters:
        use - true for using the configuration.
      • getLogFormat

        public String getLogFormat()
        Replies the format of the log.
        Returns:
        the format, never null.
      • setLogFormat

        public void setLogFormat​(String format)
        Change the format of the log.
        Parameters:
        format - the format.