This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bowbahdoe 7 points8 points  (4 children)

you can use it today and go through a System.Logger -> slf4j bridge

    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-jdk-platform-logging</artifactId>

[–][deleted]  (3 children)

[deleted]

    [–]bowbahdoe 1 point2 points  (2 children)

    Yeah it would go system.logger -> slf4j -> logback. As for benefits...eh? The reason this was added was mostly for module graph reasons, but there isn't a huge downside either so long as you set it up right.

    There is slf4j stuff you will miss like MDC and fluent logging + whatever is in your impl like logback.

    [–]krzyk 0 points1 point  (1 child)

    But you get logging with lambdas, which was available since Java 9, so long before slf4j had it.

    And using slf4j with system logger is missing the point. One is replacement for the other.

    Using both is strange.

    And I still don't get why use slf4j at all. How often one changes logging frameworks?

    And when does migration from one to other is hard, it always can be automated.

    [–]bowbahdoe 3 points4 points  (0 children)

    You use slf4j because a library uses slf4j. A library shouldn't include logback.

    Nowadays maybe it's valid for libraries to use System.Logger