Claus Ibsen created CAMEL-23490:
-----------------------------------

             Summary: 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
             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)

Reply via email to