[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:38:01 CEST 2019


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

Ralph Goers commented on SLF4J-124:
-----------------------------------

I am not following. The translation you are talking about would never happen in SLF4J. SLF4J can't know anything about the logging implementation such as how to translate levels. It would happen in the binding between SLF4J and the implementation. In Log4j 2's case, I would simply modify log4j-slf4j-impl's Log4jLogger to map SLF4J log Levels to the Levels that the Log4j API uses, which is exactly what Log4j does for JUL. It really is not a big deal. I guess it might impact Logback the most since it uses SLF4J directly as its API, but I would expect SLF4J would simply inherit Logback's Level definitions.

> 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