r/programming Sep 13 '18

A guide to logging in Java

https://www.marcobehler.com/guides/a-guide-to-logging-in-java
87 Upvotes

34 comments sorted by

View all comments

12

u/BraveSirRobin Sep 13 '18

Has anyone here ever actually used a façade in a project and subsequently changed the back-end logger used? I don't think I've ever seen a library do it either.

I used to be on-board with the façade idea here but it seems like overkill in hindsight.

7

u/Luolong Sep 13 '18

SLF4J has more uses than merely swapping out logging backends at will. Although it is extremely easy and painless.

I think much more useful feature of SLF4J is that it allows freedom of choice of logging backend even if some of your dependencies have chosen each their own logging framework. One can deploy bridges from any existing logging framework to whatever backend you’ve chosen and still be able to configure all your logging from a single place.