Class LogbackLogger

  • All Implemented Interfaces:
    Logger

    @FeatureToggle(featureID="CM-0001")
    public class LogbackLogger
    extends Object
    implements Logger
    Implementation of the Logger as Wrapper for SLF4j and logback Framework.
    • Constructor Detail

      • LogbackLogger

        public LogbackLogger​(Class<?> instance)
        Create an instance of the logging class. THe configuration file will be searched in the Directory, where the application is running.
        Parameters:
        instance - The instance of the logged CLASS
        See Also:
        /logback.xml If is no configuration present at this position, the logger use the default configuration in the classpath, with the console appender.
    • Method Detail

      • log

        public LogLevel log​(String message,
                            LogLevel level)
        Description copied from interface: Logger
        Create a Log-Entry with the given message for the configured Log-Level. Log-Level: TRACE | DEBUG | INFO | WARN | ERROR
        Specified by:
        log in interface Logger
        Parameters:
        message - the LogMessage as String.
        level - as LogLevel.
        Returns:
        LogLevel
      • getConfiguredLogLevel

        public LogLevel getConfiguredLogLevel()
        Description copied from interface: Logger
        Get the configured LogLevel for the Logger.
        Specified by:
        getConfiguredLogLevel in interface Logger
        Returns:
        LogLevel
      • catchException

        public String catchException​(Exception ex)
        Description copied from interface: Logger
        Modified Method to log Exceptions. The output will be the exception Name and the exception message in the LogLevel Error. In the case a NullPointerException is thrown, the StackTrace will be logged too.
        Specified by:
        catchException in interface Logger
        Parameters:
        ex - as Exception
        Returns:
        exception Message as String
      • setLogLevel

        public void setLogLevel​(LogLevel level)
        Description copied from interface: Logger
        Set the LogLevel programmatically. Log-Level: TRACE | DEBUG | INFO | WARN | ERROR
        Specified by:
        setLogLevel in interface Logger
        Parameters:
        level - as LogLevel