<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi All,</div><div><br></div><div>Thanks for your great feedback. Before discussing this issue further, here are some context.</div><div><br></div><div>As you already know, the log4j vulnerability crisis was a significant issue recently. Of course, using slf4j as a facade and making log implementation pluggable is THE SOLUTION but, it has one limitation: as Gülcü already stated, slf4j does not support dynamic log level change feature, which is such a desirable feature for maintenance.</div><div><br></div><div>Because of that, many projects can't use slf4j. For example, Apache Kafka calls log4j API directly, and Spring boot uses logback, without the slf4j facade.</div><div><br></div><div>(related discussion: <a href="https://lists.apache.org/thread/4gyyjmfp92xvl1661qdgpx70l0gg04yd">https://lists.apache.org/thread/4gyyjmfp92xvl1661qdgpx70l0gg04yd</a> disclaimer: I am working on Apache Kafka's log4j 2.x upgrading issue.)</div><div><br></div><div>Upon the context above, I hope to propose the following features to slf4j-api:</div><div><br></div><div>1. Add OFF level, which enables dynamic turning on/off the logger.</div><div>2. Upon 1 and SLF4J-124, add Logger#setLevel(Level) method.</div><div><br></div><div>With this feature, for example, `slf4j-simple` can dynamically adjust its logger level (`SimpleLogger#currentLogLevel`):</div><div><br></div><div><a href="https://github.com/qos-ch/slf4j/blob/master/slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java">https://github.com/qos-ch/slf4j/blob/master/slf4j-simple/src/main/java/org/slf4j/simple/SimpleLogger.java</a></div><div><br></div><div>How do you think?</div><div><br></div><div>Best,</div><div>Dongjin</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 28, 2022 at 4:40 AM Matt Sicker <<a href="mailto:boards@gmail.com">boards@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">It might be beneficial to support the equivalent of levels by<br>
interpreting them as integral values. log4j-api supports custom log<br>
levels, and those all work due to levels having an integral value to<br>
compare them against each other. From a Logger API perspective, it<br>
doesn't really make sense to log messages at OFF or ALL, especially as<br>
they tend to do the opposite of their name (e.g., logging at the OFF<br>
level means "always log" as OFF is a higher level than FATAL, while<br>
logging at the ALL level means it never gets logged as ALL is lower<br>
than TRACE).<br>
<br>
On Thu, Jan 27, 2022 at 9:57 AM Joakim Erdfelt <<a href="mailto:joakim.erdfelt@gmail.com" target="_blank">joakim.erdfelt@gmail.com</a>> wrote:<br>
><br>
> While slf4j is just a facade, there's a growing group of features in various projects that put configuration at the slf4j api level (both at startup and runtime), not at the slf4j implementation level.<br>
><br>
> Am I wrong in assuming that the stated scope of this was for this proposal to have slf4j api level ability?<br>
><br>
> - Joakim<br>
><br>
> On Thu, Jan 27, 2022 at 8:42 AM Ceki Gülcü <<a href="mailto:ceki@qos.ch" target="_blank">ceki@qos.ch</a>> wrote:<br>
>><br>
>><br>
>><br>
>> On 1/27/2022 2:55 PM, Joakim Erdfelt wrote:<br>
>> > I like it.<br>
>> ><br>
>> > OFF is definitely useful, and should be there.<br>
>> ><br>
>> > ALL on the other hand seems redundant.<br>
>> > Just setting the most noisy level (TRACE in slf4j terms) would be the<br>
>> > equivalent end result.<br>
>><br>
>> Unless I am forgetting something or getting forgetful, SLF4J does not<br>
>> allow users to set levels.<br>
>><br>
>> > - Joakim<br>
>><br>
>> --<br>
>> Ceki Gülcü<br>
>><br>
>> Sponsoring SLF4J/logback/reload4j at <a href="https://github.com/sponsors/qos-ch" rel="noreferrer" target="_blank">https://github.com/sponsors/qos-ch</a><br>
>> _______________________________________________<br>
>> slf4j-user mailing list<br>
>> <a href="mailto:slf4j-user@qos.ch" target="_blank">slf4j-user@qos.ch</a><br>
>> <a href="http://mailman.qos.ch/mailman/listinfo/slf4j-user" rel="noreferrer" target="_blank">http://mailman.qos.ch/mailman/listinfo/slf4j-user</a><br>
><br>
> _______________________________________________<br>
> slf4j-user mailing list<br>
> <a href="mailto:slf4j-user@qos.ch" target="_blank">slf4j-user@qos.ch</a><br>
> <a href="http://mailman.qos.ch/mailman/listinfo/slf4j-user" rel="noreferrer" target="_blank">http://mailman.qos.ch/mailman/listinfo/slf4j-user</a><br>
_______________________________________________<br>
slf4j-user mailing list<br>
<a href="mailto:slf4j-user@qos.ch" target="_blank">slf4j-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/slf4j-user" rel="noreferrer" target="_blank">http://mailman.qos.ch/mailman/listinfo/slf4j-user</a></blockquote></div><br clear="all"><div><div><br></div><div>--</div><div>Dongjin Lee</div><div><br></div><div>A hitchhiker in the mathematical world.</div><div><br></div><div>github: <a href="http://github.com/dongjinleekr">github.com/dongjinleekr</a></div><div>keybase: <a href="https://keybase.io/dongjinleekr">https://keybase.io/dongjinleekr</a></div><div>linkedin: <a href="http://kr.linkedin.com/in/dongjinleekr">kr.linkedin.com/in/dongjinleekr</a></div><div>speakerdeck: <a href="http://speakerdeck.com/dongjin">speakerdeck.com/dongjin</a></div></div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><i></i></div></div></div></div></div></div></div></div></div></div>