[slf4j-user] Question: supporting ALL, OFF level

Joakim Erdfelt joakim.erdfelt at gmail.com
Thu Jan 27 14:55:03 CET 2022


I like it.

OFF is definitely useful, and should be there.

ALL on the other hand seems redundant.
Just setting the most noisy level (TRACE in slf4j terms) would be the
equivalent end result.

- Joakim

On Thu, Jan 27, 2022 at 7:37 AM Dongjin Lee <dongjin at apache.org> wrote:

> Hi, slf4j community,
>
> I have a question on slf4j-api's Level definition.
>
> As far as I know, the slf4j community is planning to support the dynamic
> logging level change feature with https://jira.qos.ch/browse/SLF4J-124.
> However, since slf4j-api only defines five levels, omitting `ALL` and `OFF`
> (below), we can't call a method like `logger.setLevel(Level.OFF)` - which
> is available in other logging frameworks.
>
>
> https://github.com/qos-ch/slf4j/blob/master/slf4j-api/src/main/java/org/slf4j/event/EventConstants.java
>
> For example, logback supports seven levels (i.e., five common ones + ALL,
> OFF):
>
>
> https://github.com/qos-ch/logback/blob/master/logback-classic/src/main/java/ch/qos/logback/classic/Level.java
>
> Log4j supports 8 levels (i.e., five common ones + FATAL, ALL, OFF):
>
>
> https://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/Level.html
>
> Java's official logging level definition is a little bit different, but
> they also support ALL, OFF:
>
> https://docs.oracle.com/javase/7/docs/api/java/util/logging/Level.html
>
> So, in my humble opinion, to make the dynamic logging level change feature
> more complete, slf4j-api is much better to support ALL and OFF levels. What
> do you think?
>
> If you agree and open an issue, I am willing to contribute.
>
> Best,
> Dongjin
>
> --
>
> Dongjin Lee
>
> A hitchhiker in the mathematical world.
>
> github: github.com/dongjinleekr
> keybase: https://keybase.io/dongjinleekr
> linkedin: kr.linkedin.com/in/dongjinleekr
> speakerdeck: speakerdeck.com/dongjin
> _______________________________________________
> slf4j-user mailing list
> slf4j-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/slf4j-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20220127/5d2bc614/attachment.html>


More information about the slf4j-user mailing list