Class LogbackLogger

java.lang.Object
org.europa.together.application.LogbackLogger
All Implemented Interfaces:
Logger

public class LogbackLogger extends Object implements Logger
Implementation of the Logger as Wrapper for SLF4j and logback Framework.
  • Constructor Details

    • 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 Details

    • log

      public LogLevel log(String message, LogLevel level)
      Description copied from interface: Logger
      Create a log entry with the given message for the configured LogLevel. Log-Level: TRACE | DEBUG | INFO | WARN | ERROR
      Specified by:
      log in interface Logger
      Parameters:
      message - 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