Skip to content

Commit fdf38b1

Browse files
committed
Fix log4j-to-slf4j JPMS and OSGi descriptors
Due to the upgrade from SLF4J 1.7.x to 2.x, the JPMS and OSGi descriptors of `log4j-to-slf4j` suffer from these shortcomings: * the JPMS descriptor uses a filebased `slf4j-api` module name (instead of `org.slf4j`, * the OSGi descriptor accepts a restricted range of SLF4J versions: [2, 3). Since `slf4j-api` 2.x is technically just a minor version update of `slf4j-api` 1.7.x, we should use an extended range of [1.7, 3). Closes #1983.
1 parent b6673e7 commit fdf38b1

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

log4j-to-slf4j/pom.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,16 @@
3232
<!--
3333
~ OSGi and JPMS options
3434
-->
35-
<slf4j.support.bound>3</slf4j.support.bound>
35+
<slf4j.support.range>[1.7,3)</slf4j.support.range>
3636
<bnd-extra-package-options>
3737
<!-- This bridge also support SLF4J 2.x -->
38-
org.slf4j.*;version="${range;[==,${slf4j.support.bound})}"
38+
org.slf4j.*;version="${slf4j.support.range}"
3939
</bnd-extra-package-options>
40+
<bnd-extra-module-options>
41+
<!-- The module descriptor is in `META-INF/versions/9`
42+
BND 6.x can not find it -->
43+
org.slf4j;substitute="slf4j-api"
44+
</bnd-extra-module-options>
4045
</properties>
4146
<dependencies>
4247
<dependency>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://logging.apache.org/log4j/changelog"
4+
xsi:schemaLocation="http://logging.apache.org/log4j/changelog https://logging.apache.org/log4j/changelog-0.1.2.xsd"
5+
type="fixed">
6+
<issue id="1983" link="https://github.com/apache/logging-log4j2/pull/1983"/>
7+
<description format="asciidoc">
8+
Fix `log4j-to-slf4j` JPMS and OSGi descriptors.
9+
</description>
10+
</entry>

0 commit comments

Comments
 (0)