[slf4j-dev] [JIRA] (SLF4J-384) Implement slf4j to log4j2 bridge/adapter/impl

QOS.CH (JIRA) noreply-jira at qos.ch
Thu Feb 23 04:59:00 CET 2017


    [ https://jira.qos.ch/browse/SLF4J-384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18203#comment-18203 ] 

Jeremy Landis commented on SLF4J-384:
-------------------------------------

This issue should be closed.  If anything maybe mention in slf4j document what to use from log4j2 team to integrate well if that isn't there already.  I do find this to be a trival issue and user should have did a bit more research before opening a ticket. 

> Implement slf4j to log4j2 bridge/adapter/impl
> ---------------------------------------------
>
>                 Key: SLF4J-384
>                 URL: https://jira.qos.ch/browse/SLF4J-384
>             Project: SLF4J
>          Issue Type: New Feature
>            Reporter: John Tal
>            Assignee: SLF4J developers list
>            Priority: Minor
>
> Sorry if this is a dumb question. But I cannot find how slf4j would integrate on top of log4j2. 
> I have tried using slf4j 1.7.21 with log4j 2.7 and keep running into this: Failed to instantiate SLF4J LoggerFactory Reported exception: java.lang.NoClassDefFoundError: org/apache/log4j/Level at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150) at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124) 
> From what I can see, LoggerFactory is bound to log4j pre 2.0 as there is no .logging. in the package names: package org.slf4j.impl; import org.apache.log4j.Level; import org.slf4j.ILoggerFactory; import org.slf4j.LoggerFactory; import org.slf4j.helpers.Util; import org.slf4j.spi.LoggerFactoryBinder; /** * The binding of {@link LoggerFactory} class with an actual instance of * {@link ILoggerFactory} is performed using information returned by this class. * * @author Ceki Gülcü */ public class StaticLoggerBinder implements LoggerFactoryBinder { 
> If I want log4j2, and don't want to be locked into API, I can't use slf4j. I have to go back to commons-logging (JCL). Seems like a waste because JCL and it's class loader / config confusion is what led to creation of slf4j.  I'd rather keep on using slf4j and plug into whatever is the fastest logging framework at the time. From all the stats I see today, that is log4j2.  



--
This message was sent by Atlassian JIRA
(v7.3.1#73012)


More information about the slf4j-dev mailing list