You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Dmytro Sylaiev (Jira)" <ji...@apache.org> on 2025/01/08 10:34:00 UTC

[jira] [Created] (CXF-9096) cxf-core LogUtils unable to static init loggerClass when slf4j v2 is used

Dmytro Sylaiev created CXF-9096:
-----------------------------------

             Summary: cxf-core LogUtils unable to static init loggerClass when slf4j v2 is used 
                 Key: CXF-9096
                 URL: https://issues.apache.org/jira/browse/CXF-9096
             Project: CXF
          Issue Type: Bug
    Affects Versions: 4.0.6, 3.6.5, 3.5.10, 4.1.0
            Reporter: Dmytro Sylaiev


When running cxf code, LogUtils initialize the logger class and when there's no explicit specification, it loads the Slf4j StaticLoggerBinder [https://github.com/apache/cxf/blob/main/core/src/main/java/org/apache/cxf/common/logging/LogUtils.java#L101] to check if slf4j is in classpath and then initialize org.slf4j.LoggerFactory::getILoggerFactory

 

The problem is that for slf4j-api v2 the StaticLoggerBinder class was removed and when we use CXF with slf4j v2 it doesn't set any value to the loggerClass field out of the box, so user need to either call setLoggerClass method or set the "org.apache.cxf.Logger" system property/resource.

 

Is it expected behavior?



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