Skip to content

Commit d5db5c4

Browse files
Liquibase 4.x support (#9)
Overhaul library to support Liquibase 4.x.
1 parent 9eb3dc5 commit d5db5c4

33 files changed

+1472
-1089
lines changed

.java-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.8

.travis.yml

+14-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,19 @@ language: java
44
sudo: false
55

66
jdk:
7-
- oraclejdk8
8-
- oraclejdk7
9-
- openjdk6
7+
- openjdk8
8+
- openjdk11
9+
10+
before_script:
11+
- export ANT_VERSION=1.10.8
12+
- wget --no-cookies https://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz
13+
- wget --no-cookies https://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz.sha512
14+
- echo "$(cat apache-ant-${ANT_VERSION}-bin.tar.gz.sha512) apache-ant-${ANT_VERSION}-bin.tar.gz" | sha512sum -c
15+
- tar -zvxf apache-ant-${ANT_VERSION}-bin.tar.gz -C /opt/
16+
- ln -s /opt/apache-ant-${ANT_VERSION} /opt/ant
17+
- rm -f apache-ant-${ANT_VERSION}-bin.tar.gz
18+
- rm -f apache-ant-${ANT_VERSION}-bin.tar.gz.sha512
19+
- export PATH="/opt/ant/bin:$PATH"
1020

1121
script:
12-
- ant build
22+
- ant clean build check

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2012-2015 Matt Bertolini
1+
Copyright (c) 2012-2020 Matt Bertolini
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
44
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the

README.md

+57-22
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
# liquibase-slf4j
2-
Version 2.0.0<br/>
2+
Version 3.0.0<br/>
33
Written by Matt Bertolini
44

5-
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.mattbertolini/liquibase-slf4j/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.mattbertolini/liquibase-slf4j)
5+
[![Maven Central](https://img.shields.io/maven-central/v/com.mattbertolini/liquibase-slf4j.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.mattbertolini%22%20AND%20a:%22liquibase-slf4j%22)
66
[![Build Status](https://travis-ci.org/mattbertolini/liquibase-slf4j.svg?branch=master)](https://travis-ci.org/mattbertolini/liquibase-slf4j)
77

8+
An implementation of the Liquibase logger that delegates directly to SLF4J.
9+
10+
Liquibase has a logging mechanism that delegates to `java.util.logging`. It works great with SLF4J out of the box if
11+
you use `jul-to-slf4j` library. Unfortunately, there is a known
12+
[performance impact](http://www.slf4j.org/legacy.html#jul-to-slf4j) when bridging `java.util.logging` to SLF4J. This
13+
library helps to eliminate that performance impact by logging Liquibase directly to SLF4J.
14+
815
## How to Use
916
Grab the library from Maven Central and place it in your classpath.
1017

@@ -14,31 +21,38 @@ Grab the library from Maven Central and place it in your classpath.
1421
<dependency>
1522
<groupId>com.mattbertolini</groupId>
1623
<artifactId>liquibase-slf4j</artifactId>
17-
<version>2.0.0</version>
24+
<version>3.0.0</version>
25+
<scope>runtime</scope>
1826
</dependency>
1927
```
2028

2129
**Gradle:**
2230

2331
```groovy
24-
runtime group: 'com.mattbertolini', name: 'liquibase-slf4j', version: '2.0.0'
32+
runtimeOnly 'com.mattbertolini:liquibase-slf4j:3.0.0'
2533
```
2634

2735
**Ivy**
2836

2937
```xml
30-
<dependency org="com.mattbertolini" name="liquibase-slf4j" rev="2.0.0"/>
38+
<dependency org="com.mattbertolini" name="liquibase-slf4j" rev="3.0.0"/>
3139
```
3240

3341
## License
3442
liquibase-slf4j is licensed under the [MIT License](http://www.opensource.org/licenses/mit-license.php)
3543

3644
## Notes
3745
This logger has a priority number of 5. If there is more than one Liquibase logger on the classpath the one with the
38-
highest priority will be used.
46+
highest priority will be used. The priority number can be changed by setting the system property
47+
`com.mattbertolini.liquibase.logging.slf4j.Slf4jLogService.priority` to an integer value of your choice.
48+
49+
Version 4 of Liquibase introduced a new plugin loading mechanism based on the Java
50+
[ServiceLoader](https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html). Version 3.0.0 of this logger
51+
conforms to this new loader mechanism. If you are using Liquibase versions lower than 4, continue to use version 2.0.0
52+
of this library.
3953

4054
Liquibase version 3.4.0 had an issue loading third party loggers in some situations. This logger may not work on that
41-
version. It is recommended that you upgrade to Liquibase 3.4.1 which addresses this issue.
55+
version. It is recommended to upgrade to Liquibase 3.4.1 which addresses this issue.
4256

4357
### Log Level Mappings
4458

@@ -48,9 +62,17 @@ version. It is recommended that you upgrade to Liquibase 3.4.1 which addresses t
4862
<th>SLF4J Level</th>
4963
</tr>
5064
<tr>
65+
<td>~~Debug~~ (Deprecated)</td>
5166
<td>Debug</td>
67+
</tr>
68+
<tr>
69+
<td>Fine</td>
5270
<td>Debug</td>
5371
</tr>
72+
<tr>
73+
<td>Config</td>
74+
<td>Info</td>
75+
</tr>
5476
<tr>
5577
<td>Info</td>
5678
<td>Info</td>
@@ -67,8 +89,8 @@ version. It is recommended that you upgrade to Liquibase 3.4.1 which addresses t
6789

6890
## Build and Test
6991
### Requirements
70-
* [Apache Ant](http://ant.apache.org/) - Version 1.8 or higher.
71-
* JDK 6 or higher (Compiled with 1.6 source and target).
92+
* [Apache Ant](http://ant.apache.org/) - Version 1.10.6 or higher.
93+
* JDK 8 or higher (Compiled with 1.8 source and target).
7294

7395
### Build
7496
To build this project, clone the repo and run the ```ant``` command:
@@ -78,43 +100,56 @@ $ cd liquibase-slf4j
78100
$ ant
79101
```
80102

81-
The distributable jar files will be located in the ```dist``` folder. The build reports (unit test, dependency,
82-
coverage, etc.) will be located in the ```build/reports``` dir.
103+
The distributable jar files will be located in the ```dist``` folder. The build reports (unit test, coverage, etc.)
104+
will be located in the ```build/reports``` dir.
83105

84-
To run the unit tests run the ```run-unit-tests``` task.
106+
To list all available tasks:
85107
```
86-
$ ant run-unit-tests
108+
$ ant -p
87109
```
88110

89111
## Bugs
90-
Please report any bugs in the issue tracker above. Please be as detailed as possible in your report so I can create
112+
Please report any bugs in the issue tracker above. Please be as detailed as possible in the report, so I can create
91113
unit tests to verify the problem is fixed.
92114

93115
## Release Notes
94116

117+
**3.0.0 - 2020-07-23**
118+
119+
- Upgraded to Liquibase version 4.0.0. This is a breaking change as the logging API changed significantly. Use version
120+
2.x if you are using Liquibase versions lower than 4.0.0.
121+
- Upgraded to SLF4J 1.7.30.
122+
- Added the ability to change the priority number of the logger by setting a Java property. To change the priority, set
123+
the `com.mattbertolini.liquibase.logging.slf4j.Slf4jLogService.priority` property to an integer value.
124+
- Repackaged logger now that package name is no longer used for locating third-party loggers.
125+
- Java 8 is now the minimum supported JDK version.
126+
- Added an `Automatic-Module-Name` to support the Java 9+ module system. The module name is `com.mattbertolini.liquibase.logging.slf4j`.
127+
- Overhauled build files.
128+
129+
95130
**2.0.0 - 2015-12-16**
96131

97-
* Switched the dependency scope of SLF4J and Liquibase to `provided`. This is because most users are already including
132+
- Switched the dependency scope of SLF4J and Liquibase to `provided`. This is because most users are already including
98133
their own versions of these libraries and the versions are often much newer than what is defined in this library. By
99134
marking them as `provided` it helps prevent version conflicts and extra exclusions in project files. For an example of
100135
this, check out the POM file from [Dropwizard](https://github.com/dropwizard/dropwizard/blob/a0bdb73053872e73762af4f940b893f78a363c2e/dropwizard-bom/pom.xml#L145-L159)
101-
* The minimum required Liquibase version is now 3.2.0. This is done to take advantage of updates to `AbstractLogger`.
136+
- The minimum required Liquibase version is now 3.2.0. This is done to take advantage of updates to `AbstractLogger`.
102137

103138
**1.2.1 - 2013-10-12**
104139

105-
* Only printing the changeLogName and changeSetName if they are provided. This gets rid of the annoying nulls printed
140+
- Only printing the changeLogName and changeSetName if they are provided. This gets rid of the annoying nulls printed
106141
in logs.
107142

108143
**1.2.0 - 2013-09-30**
109144

110-
* Upgrading to Liquibase version 3.0.5 to add new required methods.
145+
- Upgrading to Liquibase version 3.0.5 to add new required methods.
111146

112147
**1.1.0 - 2013-08-10**
113148

114-
* Upgrade Liquibase version to 3.0.x.
115-
* Backward-compatible with previous version.
149+
- Upgrade Liquibase version to 3.0.x.
150+
- Backward-compatible with previous version.
116151

117152
**1.0.0 - 2012-04-04**
118153

119-
* Initial release.
120-
* Supports Liquibase 2.0.x.
154+
- Initial release.
155+
- Supports Liquibase 2.0.x.

build-publish.xml

-73
This file was deleted.

build.properties

+5-38
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,12 @@
11
project.name=liquibase-slf4j
2-
project.home=${basedir}
3-
project.version=2.0.0
2+
project.version=3.0.0
43

4+
java.source.version=1.8
5+
java.target.version=1.8
6+
7+
# Used in pom-template.xml
58
project.description=Liquibase SLF4J Logger
69
project.url=https://github.com/mattbertolini/liquibase-slf4j
710
project.scm.readonly.url=git://github.com/mattbertolini/liquibase-slf4j.git
811
project.license.name=MIT License
912
project.license.url=http://www.opensource.org/licenses/mit-license.html
10-
11-
lib.dir=${basedir}/lib
12-
lib.compile.dir=${lib.dir}/compile
13-
lib.test.dir=${lib.dir}/test
14-
lib.build.dir=${lib.dir}/build
15-
lib.findbugs.dir=${lib.dir}/findbugs
16-
17-
src.main.java.dir=${basedir}/src/main/java
18-
src.main.resources.dir=${basedir}/src/main/resources
19-
src.test.java.dir=${basedir}/src/test/java
20-
src.test.resources.dir=${basedir}/src/test/resources
21-
22-
build.dir=${basedir}/build
23-
build.temp.dir=${build.dir}/temp
24-
build.classes.dir=${build.dir}/classes
25-
build.instrumentedclasses.dir=${build.dir}/instrumentedclasses
26-
build.test.classes.dir=${build.dir}/testclasses
27-
build.resources.dir=${build.dir}/resources
28-
build.test.resources.dir=${build.dir}/testresources
29-
build.javadoc.dir=${build.dir}/javadoc
30-
build.reports.dir=${build.dir}/reports
31-
build.reports.dependency.dir=${build.reports.dir}/dependency
32-
build.reports.unittest.dir=${build.reports.dir}/unittest
33-
build.reports.coverage.dir=${build.reports.dir}/coverage
34-
build.reports.findbugs.dir=${build.reports.dir}/findbugs
35-
build.reports.xref.dir=${build.reports.dir}/xref
36-
build.ivy.resolutioncache.dir=${build.temp.dir}/resolutioncache
37-
38-
dist.dir=${basedir}/dist
39-
40-
project.java.source.version=1.6
41-
project.java.target.version=1.6
42-
project.ivy.version=2.4.0
43-
44-
findbugs.mem.initial=128m
45-
findbugs.mem.max=256m

0 commit comments

Comments
 (0)