ppkarwasz commented on issue #2065:
URL: 
https://github.com/apache/logging-log4j2/issues/2065#issuecomment-1842375871

   @bpholt,
   
   Thanks for using Log4j API[1] and noticing the problem. I believe that the 
source of the problem might be in 
[Coursier](https://github.com/coursier/coursier).
   
   We use both SLF4J 1.7.x and 2.x (for `log4j-slf4j-impl`) in our build. In 
the `org.apache.logging.log4j:log4j` artifact (parent of `log4j-slf4j-impl`) we 
define the version of SLF4J:
   
   ```xml
   <properties>
     <slf4j.api>2.0.9</slf4j.api>
   </properties>
   <dependencies>
       <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-api</artifactId>
         <version>${slf4j.version}</version>
       </dependency>
   </dependencies>
   ```
   
   while in the `log4j-slf4j-impl` we define:
   
   ```xml
   <properties>
     <slf4j.version>1.7.25</slf4j.version>
   </properties>
   ```
   
   This way to override dependency version is supported by **Maven** (Spring 
Boot uses it extensively):
   
   ```
   [INFO] --- dependency:2.8:tree (default-cli) @ sandbox ---
   [INFO] eu.copernik.sandbox:sandbox:jar:0.0.1-SNAPSHOT
   [INFO] \- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.22.0:runtime
   [INFO]    +- org.apache.logging.log4j:log4j-api:jar:2.22.0:runtime
   [INFO]    +- org.slf4j:slf4j-api:jar:1.7.25:runtime
   [INFO]    \- org.apache.logging.log4j:log4j-core:jar:2.22.0:runtime
   ```
   
   Coursier might have a problem with this. You should probably report it there.
   
   [1] the problem would not have appeared if you had `slf4j-api` as direct 
dependency.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to