Fact is most people beginning java programming just leave exception handling for later. As the e.printStackTrace(); littering my code have annoyed me for too long now and having read the very informative article here I realized that the Right Thing is apparently to rethrow the exceptions and log in the highest possible level (at least for checked exceptions – which is the thing I care for at the moment). So I have to look at loggers (which is a whole subject I guess, meaning should I create them per class, per method, should I wrap them etc) but first things first : should I go for some specialized lib (like apache’s log4j) or even better for a wrapper (like SLF4J) or stay with java.util.logging ? What are you people using and why ?
Thanks
In my (an many other’s) opinion, you should absolutely use a third-party logging solution – java.util.logging has lots of ‘issues’. Log4J is handy, and widely-used, but SLF4J is better. Better yet, Logback is an SLF4J implementation that was written by the same person who wrote Log4J, so it’s the current recommended solution for those who would otherwise use Log4J.