Class LoggerConfiguration


  • public class LoggerConfiguration
    extends Object
    The logger configuration builder using logback-classic.

    It can be configured with following properties:

    • logging.config - the path to custom logback config file
    • logging.path - the directory where log files are saved
    • logging.pattern.file - the logging pattern for file appender
    • logging.pattern.console - the logging pattern for console appender
    • logging.level.root - the logging level of root logger
    • logging.level.com.axelor - the logging level of given logger

    If logging.config is given, all other properties will be ignored.
    If logging.path is not given, file appender will be disabled
    If logging.pattern.file is set to OFF, file appender will be disabled
    If logging.pattern.console is set to OFF, console appender will be disabled
    If logback.xml is found in classpath and skipDefaultConfig is false, no custom configuration is done.

    The logging pattern can use %clr() to highlight based on log level, or %clr(){color} with faint, red, green, yellow, blue, magenta, cyan as color to style the log message on console output.

    • Constructor Detail

      • LoggerConfiguration

        public LoggerConfiguration​(Properties config)
    • Method Detail

      • skipDefaultConfig

        public void skipDefaultConfig​(boolean skipDefaultConfig)
      • install

        public void install()
      • uninstall

        public void uninstall()
      • conversionRule

        public void conversionRule​(String word,
                                   Class<? extends ch.qos.logback.core.pattern.Converter<?>> converter)