Liquibase SLF4J Logger.
Version 5.0.0
Written by Matt Bertolini
An implementation of the Liquibase logger that delegates directly to SLF4J.
Liquibase has a logging mechanism that delegates to java.util.logging
. It works great with SLF4J out of the box if
you use jul-to-slf4j
library. Unfortunately, there is a known
performance impact when bridging java.util.logging
to SLF4J. This
library helps to eliminate that performance impact by logging Liquibase directly to SLF4J.
Grab the library from Maven Central and place it in your classpath.
Maven:
<dependency>
<groupId>com.mattbertolini</groupId>
<artifactId>liquibase-slf4j</artifactId>
<version>5.0.0</version>
<scope>runtime</scope>
</dependency>
Gradle:
Groovy DSL:
runtimeOnly 'com.mattbertolini:liquibase-slf4j:5.0.0'
Kotlin DSL:
runtimeOnly("com.mattbertolini:liquibase-slf4j:5.0.0")
Ivy
<dependency org="com.mattbertolini" name="liquibase-slf4j" rev="5.0.0"/>
liquibase-slf4j is licensed under the MIT License
This logger has a priority number of 5. If there is more than one Liquibase logger on the classpath the one with the
highest priority will be used. The priority number can be changed by setting the system property
com.mattbertolini.liquibase.logging.slf4j.Slf4jLogService.priority
to an integer value of your choice.
Version 4 of Liquibase introduced a new plugin loading mechanism based on the Java ServiceLoader. Version 3.0.0 of this logger conforms to this new loader mechanism. If you are using Liquibase versions lower than 4, continue to use version 2.0.0 of this library.
Liquibase version 3.4.0 had an issue loading third party loggers in some situations. This logger may not work on that version. It is recommended to upgrade to Liquibase 3.4.1 which addresses this issue.
Liquibase Level | SLF4J Level |
---|---|
Debug | |
Fine | Debug |
Config | Info |
Info | Info |
Warning | Warn |
Severe | Error |
To build this project, clone the repo and run the ant
command:
$ git clone https://github.com/mattbertolini/liquibase-slf4j.git
$ cd liquibase-slf4j
$ ant
The distributable jar files will be located in the dist
folder. The build reports (unit test, coverage, etc.)
will be located in the build/reports
dir.
To list all available tasks:
$ ant -p
Please report any bugs in the issue tracker above. Please be as detailed as possible in the report, so I can create unit tests to verify the problem is fixed.
5.0.0 - 2023-03-20
4.1.0 - 2022-03-30
4.0.0 - 2020-09-30
3.0.0 - 2020-07-23
com.mattbertolini.liquibase.logging.slf4j.Slf4jLogService.priority
property to an integer value.Automatic-Module-Name
to support the Java 9+ module system. The module name is com.mattbertolini.liquibase.logging.slf4j
.2.0.0 - 2015-12-16
provided
. This is because most users are already including
their own versions of these libraries and the versions are often much newer than what is defined in this library. By
marking them as provided
it helps prevent version conflicts and extra exclusions in project files. For an example of
this, check out the POM file from Dropwizard
AbstractLogger
.1.2.1 - 2013-10-12
1.2.0 - 2013-09-30
1.1.0 - 2013-08-10
1.0.0 - 2012-04-04