[slf4j-dev] [JIRA] (SLF4J-124) Add ability to log at a dynamic level

QOS.CH (JIRA) noreply-jira at qos.ch
Wed May 8 07:09:02 CEST 2019


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

Joachim Durchholz commented on SLF4J-124:
-----------------------------------------

The big deal is that SLF4J would have to make sure that it is properly translating the levels to that backend's idea of log levels.
This isn't always trivial.

Also, people will expect numeric log levels to be passed through unchanged. (Oracle's JDBC is truly bizarre here: it does not differentiate between DEBUG and TRACE, it simply uses one or two dozen numeric log levels across the entire DEBUG and TRACE range defined by java.util.logging. Mapping this to non-numeric libraries like logback will not be possible, to Logback may get pressured into having a numeric log level anyway.)

Re whether numeric log levels are an ugly hack: Yes, but it's the least common denominator between all logging backends, and DEBUG vs. TRACE isn't granular enough for Oracle's log levels, and with JDBC, does even make sense because the more verbose log levels can generate huge amounts of trace, so if SLF4J could support the difference between 50000 and 40000 it would be helpful for ojdbc user. (I know this is just supporting and perpetuating bad architectur. But Oracle isn't going to improve this, ever, that company is driven purely be paying customer requests and doesn't care about architecture unless it hurts themselves.)

> Add ability to log at a dynamic level
> -------------------------------------
>
>                 Key: SLF4J-124
>                 URL: https://jira.qos.ch/browse/SLF4J-124
>             Project: SLF4J
>          Issue Type: Sub-task
>          Components: Core API
>    Affects Versions: 1.5.x
>         Environment: Operating System: All
> Platform: All
> URL: http://stackoverflow.com/questions/2621701/setting-log-level-of-message-at-runtime-in-slf4j
>            Reporter: Robert Elliot
>            Assignee: SLF4J developers list
>         Attachments: Util.java.patch
>
>
> It is occasionally useful to have a log method that takes a level as a parameter.  The necessary methods can be added to the Util class without any compatibility issues as far as I can see - see attached patch.



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


More information about the slf4j-dev mailing list