This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/main by this push:
     new 2df38e0a7a [log4j-to-slf4j] Adapt OSGi metadata to work with slf4j 1 
and 2
2df38e0a7a is described below

commit 2df38e0a7a1820995bd49334e5795a6d3765f1a2
Author: Hannes Wellmann <[email protected]>
AuthorDate: Thu Mar 16 15:34:26 2023 +0100

    [log4j-to-slf4j] Adapt OSGi metadata to work with slf4j 1 and 2
    
    Use the version range [1.7,3) for the imported slf4j packages.
    See also https://bnd.bndtools.org/macros/range.html
    
    Fixes https://github.com/apache/logging-log4j2/issues/1232
    
    Signed-off-by: Hannes Wellmann <[email protected]>
---
 log4j-to-slf4j/pom.xml                             |  2 ++
 .../.2.x.x/1232_log4j-to-sfl4j-2-OSGiMetadata.xml  | 29 ++++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/log4j-to-slf4j/pom.xml b/log4j-to-slf4j/pom.xml
index 66fe3e4a8d..f7543705b0 100644
--- a/log4j-to-slf4j/pom.xml
+++ b/log4j-to-slf4j/pom.xml
@@ -31,6 +31,7 @@
     <docLabel>SLF4J Documentation</docLabel>
     <projectDir>/log4j-to-slf4j</projectDir>
     <module.name>org.apache.logging.slf4j</module.name>
+    <slf4j.support.bound>3</slf4j.support.bound>
   </properties>
   <dependencies>
     <dependency>
@@ -91,6 +92,7 @@
         <configuration>
           <instructions>
             <Export-Package>org.apache.logging.slf4j</Export-Package>
+            
<Import-Package>org.slf4j*;version="${range;[==,${slf4j.support.bound})}",*</Import-Package>
           </instructions>
         </configuration>
       </plugin>
diff --git a/src/changelog/.2.x.x/1232_log4j-to-sfl4j-2-OSGiMetadata.xml 
b/src/changelog/.2.x.x/1232_log4j-to-sfl4j-2-OSGiMetadata.xml
new file mode 100644
index 0000000000..b166412c83
--- /dev/null
+++ b/src/changelog/.2.x.x/1232_log4j-to-sfl4j-2-OSGiMetadata.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xmlns="http://logging.apache.org/log4j/changelog";
+       xsi:schemaLocation="http://logging.apache.org/log4j/changelog 
https://logging.apache.org/log4j/changelog-0.1.0.xsd";
+       type="fixed">
+  <issue id="1232" 
link="https://github.com/apache/logging-log4j2/issues/1232"/>
+  <author id="hanneswell"/>
+  <author name="Hannes Wellmann"/>
+  <description format="asciidoc">
+    Adapt the OSGi metadata of log4j-to-slf4j to work with slf4j 1 and 2.
+    To achieve that use a version range of `[1.7,3)` for the imported slf4j 
packages.  
+  </description>
+</entry>

Reply via email to