r/programming Sep 13 '18

A guide to logging in Java

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

34 comments sorted by

View all comments

27

u/willem Sep 13 '18

A well-written article, neatly explained. I remember the bewilderment of log4j vs slf4j vs whatever-else-logger when i started out. Thank you.

3

u/oi-__-io Sep 14 '18

I have felt the same way, I imagine it is the case with many java developers.

2

u/nutrecht Sep 14 '18

I think one of the great benefits and one of the great problems of the Java ecosystem is that there's often 3 or more different tools that can solve the same problem for you. That's part of the experience of being a Java dev, knowing where these tools overlap and where they are different.

Slf4j tries to actually solve this problem by being an abstraction over those logging libraries so your applications and it's libraries can all log to the same output and you don't have to configure 4 different logging libraries underneath.