You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Hakky54 (via GitHub)" <gi...@apache.org> on 2023/02/01 09:17:56 UTC

[GitHub] [logging-log4j2] Hakky54 opened a new issue, #1232: log4j-to-slf4j not working with slf4j v2

Hakky54 opened a new issue, #1232:
URL: https://github.com/apache/logging-log4j2/issues/1232

   ## Description
   I am using log4j-to-slf4j to forward all log4j calls to slf4j for my library [LogCaptor](https://github.com/Hakky54/log-captor). At August 2022 slf4j maintainers released version 2 which does not work anymore with `log4j-to-slf4j`. Would it be possible to make it compatible again?
   
   A workaround for me would be forwarding log4j calls to jul and use that, but that I would not be able to use MDC for example and that is the reason why I am hoping that log4j-to-slf4j could be compatible with the latest slf4j release.
   
   [A clear and concise description of what the bug is.]
   Non log calls are being sent to slf4j (tested with v2.0.6) from log4j (tested with v2.19.0)
   
   ## Configuration
   
   **Version:** 2.19.0
   
   **Operating system:** any
   
   **JDK:** oracle jdk 1.8
   
   ## Logs
   
   ```
   [Stacktraces, errors, etc. relevant applications logs.]
   ```
   
   ## Reproduction
   Git fork and clone: https://github.com/Hakky54/log-captor
   Adjust the slf4j version to 2.0.6 and run the test with `mvn verify`
   


-- 
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: notifications-unsubscribe@logging.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] log4j-to-slf4j not working with slf4j v2 (logging-log4j2)

Posted by "HannesWell (via GitHub)" <gi...@apache.org>.
HannesWell commented on issue #1232:
URL: https://github.com/apache/logging-log4j2/issues/1232#issuecomment-1471922943

   In the OSGi world it is currently indeed impossible to use log4j-to-slf4j in conjunction with slf4j-2 because the Manifest only imports the slf4j packages only up until, but excluding 2:
   ```
   Import-Package:
    [...]
    org.slf4j;version="[1.7,2)",
    org.slf4j.spi;version="[1.7,2)"
   ```
   If log4j-to-slf4j works well with slf4j 1 and 2 I suggest to widen the package import range to "[1.7,3)".
   If the log4j maintainers are interested I can provide a corresponding PR.


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] log4j-to-slf4j not working with slf4j v2 (logging-log4j2)

Posted by "Hakky54 (via GitHub)" <gi...@apache.org>.
Hakky54 commented on issue #1232:
URL: https://github.com/apache/logging-log4j2/issues/1232#issuecomment-1473752875

   By the way guys, just out of curiosity, how come this situation works for my library with logcaptor using slf4j v2 and latest version of log4j-to-slf4j, but not working for the OSGi world?


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [logging-log4j2] Hakky54 closed issue #1232: log4j-to-slf4j not working with slf4j v2

Posted by "Hakky54 (via GitHub)" <gi...@apache.org>.
Hakky54 closed issue #1232: log4j-to-slf4j not working with slf4j v2
URL: https://github.com/apache/logging-log4j2/issues/1232


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] log4j-to-slf4j not working with slf4j v2 (logging-log4j2)

Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz closed issue #1232: log4j-to-slf4j not working with slf4j v2
URL: https://github.com/apache/logging-log4j2/issues/1232


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [logging-log4j2] Hakky54 commented on issue #1232: log4j-to-slf4j not working with slf4j v2

Posted by "Hakky54 (via GitHub)" <gi...@apache.org>.
Hakky54 commented on issue #1232:
URL: https://github.com/apache/logging-log4j2/issues/1232#issuecomment-1411827465

   Nevermind, I had a dependency management issue with dependencies having different versions. There is no issue, so I am closing it.


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] log4j-to-slf4j not working with slf4j v2 (logging-log4j2)

Posted by "HannesWell (via GitHub)" <gi...@apache.org>.
HannesWell commented on issue #1232:
URL: https://github.com/apache/logging-log4j2/issues/1232#issuecomment-1473943719

   > By the way guys, just out of curiosity, how come this situation works for my library with logcaptor using slf4j v2 and latest version of log4j-to-slf4j, but not working for the OSGi world?
   
   Because non OSGi applications usually don't care about the OSGi metadata. But the OSGi metadata said that log4j-to-slf4j required slf4j in version `[1.7,2)`. Therefore an OSGi runtime refused to resolve the `log4j.to-slf4j` if only slf4j1.7.x is available.


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] log4j-to-slf4j not working with slf4j v2 (logging-log4j2)

Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on issue #1232:
URL: https://github.com/apache/logging-log4j2/issues/1232#issuecomment-1471938958

   @HannesWell,
   
   Sure, PRs are welcome. We use `maven-bundle-plugin` to generate the OSGI manifest.


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org