[slf4j-dev] [JIRA] (SLF4J-314) slf4j not logging VERBOSE and DEBUG messages, no matter what is Logcat's loglevel

QOS.CH (JIRA) noreply-jira at qos.ch
Sun Apr 2 18:54:00 CEST 2017


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

Axel Zeilner commented on SLF4J-314:
------------------------------------

After using slf4j for many years I came across the android 1.7 problems with not logging debug/trace properly. The reference to android documentation how logcat is meant to be used is of course something to consider. On the other hand the drawbacks of Android's logging system are the cause to look for the alternatives which behave like those the developer is used to from JEE and regular Java programming which are JCL or Log4j to name the most important.

SLF4J has chosen to provide a facade to the native logging system which means that the developer of the SLF4J API needs to rely on the same behavior wherever his/her classes are deployed. In our case we need to deploy java classes on server and Android side which means we need to be able to use debug/trace because the classes already do and also the use of LoggerFactory.getLogger(MyClass.class) is a must. 

After reading long discussions on stackoverflow and many frustrated API users I just wonder why you didn't change the implementation in a way that allows the use of DEBUG just like original LogCat API does. I consider checking the loglevel in the implementation of your facade is architecturally wrong if you refer to the system's implementation which does not check either.

The recommendation to switch explicitly each TAG (i.e. class being used) via System Properties to another log level is simply impractical and makes the android implementation for your API completely useless for larger app development.

Some forks of the android implementation are far way better usable but simply not maintained. They use at simplest a flag (handroid) to switch the behavior in the constructor of the android.app.Application class.

I would like to kindly ask to consider such an implementation change that reflects on the user's benefits. If I would receive your positive feedback I would provide a patch to the latest HEAD.

 

> slf4j not logging VERBOSE and DEBUG messages, no matter what is Logcat's loglevel
> ---------------------------------------------------------------------------------
>
>                 Key: SLF4J-314
>                 URL: https://jira.qos.ch/browse/SLF4J-314
>             Project: SLF4J
>          Issue Type: Bug
>          Components: slf4j-android
>    Affects Versions: 1.7.x
>         Environment: Operating System: All
> Platform: Other
>            Reporter: Mark Zalavari
>            Assignee: SLF4J developers list
>
> It seems on android platform the isLoggable() method is always returns false for VERBOSE and DEBUG (no matter what is the actal loglevel is), so it should not be called before calling Log.d and Log.v
> The only slf4j version I know of where the DEBUG & VERBOSE logs are working is 1.6.1-RC1



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


More information about the slf4j-dev mailing list