You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Volkan Yazici (Jira)" <ji...@apache.org> on 2022/02/03 14:00:00 UTC

[jira] [Commented] (LOG4J2-3370) Typo-Bug in current SLF4J Bridge

    [ https://issues.apache.org/jira/browse/LOG4J2-3370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17486502#comment-17486502 ] 

Volkan Yazici commented on LOG4J2-3370:
---------------------------------------

Thanks for reaching out to us [~thoebert]! SLF4J 2.0 contains several breaking changes (LOG4J2-3139, LOG4J2-2975, etc.) that render {{log4j-slf4j18-impl}} broken too for those who want to combine it with SLF4J 2.0. We cannot fix these in {{log4j-sfl4j18-impl}}, since this will break the compatibility for SLF4J 1.8 users. We need to introduce a new {{log4j-sfl4j20-impl}} module. It would be great if you can contribute this!

In the meantime, I would advise using [the Log4j API|https://logging.apache.org/log4j/2.x/api-separation.html] instead. It is a fully-fledged, feature-rich logging API – just like SLF4J, but more. Not to mention it also contains a fluent API for convenience.

> Typo-Bug in current SLF4J Bridge
> --------------------------------
>
>                 Key: LOG4J2-3370
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3370
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: SLF4J Bridge
>    Affects Versions: 2.17.1
>            Reporter: Timon H.
>            Priority: Major
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The SLF4J Bridge (log4j-slf4j18-impl:2.17.1) is currently broken as it contains the same typo bug of SLF4J-API which was fixed in SLF4J-API 2.0.0-alpha3 and therefore leads to an API mismatch error. In the {_}org.apache.logging.slf4j.SLF4JServiceProvider{_}, the {_}getRequesteApiVersion{_}-Method need to be refactored to {_}getRequeste{*}d{*}ApiVersion{_}.
> h3. See the Changelog of SLF4J-API 2.0.0-alpha3: 
>  * The {{getRequesteApiVersion}} method in {{SLF4JServiceProvider}} was renamed as getRequeste{*}d{*}ApiVersion. This fixes [SLF4J-516|https://jira.qos.ch/browse/SLF4J-516].
> This leads to the following exception during the use of log4j-slf4j18-impl:2.17.1 with the current SLF4J-API:
> {{Unexpected problem occured during version sanity check}}
> {{Reported exception:}}
> {{java.lang.AbstractMethodError: Receiver class org.apache.logging.slf4j.SLF4JServiceProvider does not define or inherit an implementation of the resolved method 'abstract java.lang.String getRequestedApiVersion()' of interface org.slf4j.spi.SLF4JServiceProvider.}}
> {{    at org.slf4j.LoggerFactory.versionSanityCheck(LoggerFactory.java:297)}}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)