liquibase.ext.logging.slf4j
Class Slf4jLogger

java.lang.Object
  extended by liquibase.logging.core.AbstractLogger
      extended by liquibase.ext.logging.slf4j.Slf4jLogger
All Implemented Interfaces:
Logger, PrioritizedService

public class Slf4jLogger
extends AbstractLogger

An implementation of the Liquibase Logger that sends log output to SLF4J.

Author:
Matt Bertolini

Field Summary
 
Fields inherited from interface liquibase.servicelocator.PrioritizedService
PRIORITY_DATABASE, PRIORITY_DEFAULT
 
Constructor Summary
Slf4jLogger()
           
 
Method Summary
 void debug(String message)
          Log a debug message.
 void debug(String message, Throwable throwable)
          Log a debug message.
 int getPriority()
          Gets the logger priority for this logger.
 void info(String message)
          Log an info message.
 void info(String message, Throwable throwable)
          Log an info message.
 void setChangeLog(DatabaseChangeLog databaseChangeLog)
           
 void setChangeSet(ChangeSet changeSet)
           
 void setLogLevel(String logLevel, String logFile)
          This method does nothing in this implementation
 void setName(String name)
          Takes the given logger name argument and associates it with a SLF4J logger.
 void severe(String message)
          Logs an severe message.
 void severe(String message, Throwable throwable)
          Logs a severe message.
 void warning(String message)
          Logs a warning message.
 void warning(String message, Throwable throwable)
          Logs a warning message.
 
Methods inherited from class liquibase.logging.core.AbstractLogger
getLogLevel, setLogLevel, setLogLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Slf4jLogger

public Slf4jLogger()
Method Detail

setName

public void setName(String name)
Takes the given logger name argument and associates it with a SLF4J logger.

Parameters:
name - The name of the logger.

setLogLevel

public void setLogLevel(String logLevel,
                        String logFile)
This method does nothing in this implementation

Parameters:
logLevel - Log level
logFile - Log file

setChangeLog

public void setChangeLog(DatabaseChangeLog databaseChangeLog)

setChangeSet

public void setChangeSet(ChangeSet changeSet)

severe

public void severe(String message)
Logs an severe message. Calls SLF4J Logger.error(String).

Parameters:
message - The message to log.

severe

public void severe(String message,
                   Throwable throwable)
Logs a severe message. Calls SLF4J Logger.error(String, Throwable).

Parameters:
message - The message to log
throwable - The exception to log.

warning

public void warning(String message)
Logs a warning message. Calls SLF4J Logger.warn(String)

Parameters:
message - The message to log.

warning

public void warning(String message,
                    Throwable throwable)
Logs a warning message. Calls SLF4J Logger.warn(String, Throwable).

Parameters:
message - The message to log.
throwable - The exception to log.

info

public void info(String message)
Log an info message. Calls SLF4J Logger.info(String).

Parameters:
message - The message to log.

info

public void info(String message,
                 Throwable throwable)
Log an info message. Calls SLF4J Logger.info(String, Throwable).

Parameters:
message - The message to log.
throwable - The exception to log.

debug

public void debug(String message)
Log a debug message. Calls SLF4J Logger.debug(String).

Parameters:
message - The message to log.

debug

public void debug(String message,
                  Throwable throwable)
Log a debug message. Calls SLF4J Logger.debug(String, Throwable).

Parameters:
message - The message to log.
throwable - The exception to log.

getPriority

public int getPriority()
Gets the logger priority for this logger. The priority is used by Liquibase to determine which logger to use. The logger with the highest priority will be used. This implementation's priority is set to 5. Remove loggers with higher priority numbers if needed.

Returns:
An integer (5)