You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2026/05/13 08:35:00 UTC

[jira] [Commented] (CAMEL-23490) camel - Upgrade slf4j-api from 1.7 to 2.0

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

Claus Ibsen commented on CAMEL-23490:
-------------------------------------

We upgraded in January but there are some missing bits

> camel - Upgrade slf4j-api from 1.7 to 2.0
> -----------------------------------------
>
>                 Key: CAMEL-23490
>                 URL: https://issues.apache.org/jira/browse/CAMEL-23490
>             Project: Camel
>          Issue Type: Dependency upgrade
>            Reporter: Claus Ibsen
>            Priority: Major
>             Fix For: 4.x
>
>
> ❯ what is the major difference between slf4j-api 1.7 and 2.0
> ⏺ The major difference is the service provider mechanism:
>   - SLF4J 1.7 uses the legacy StaticLoggerBinder class-path discovery. Bindings (e.g. slf4j-log4j12, logback-classic) ship a org.slf4j.impl.StaticLoggerBinder class that SLF4J finds at compile
>   time.
>   - SLF4J 2.0 switches to Java's ServiceLoader (java.util.ServiceLoader) via the SLF4JServiceProvider SPI interface. Bindings now register themselves in
>   META-INF/services/org.slf4j.spi.SLF4JServiceProvider.
>   Other notable changes in 2.0:
>   - Fluent logging API — logger.atInfo().addKeyValue("k", v).setMessage("...").log()
>   - Built-in support for key-value pairs (structured logging) in the LoggingEvent API
>   - Requires Java 8+ (1.7 supported Java 5+)
>   - Old bindings like slf4j-log4j12 are replaced by slf4j-reload4j; the log4j-over-slf4j bridge is renamed to log4j-over-slf4j2
>   The SPI change is what breaks backward compatibility — a logging backend built for 1.7 won't be discovered by 2.0 and vice versa.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)