Digging into some Java logging stuff, and question about slf4j. It seems awfully convenient, always doing the logging same way in .java files, worrying only about logger name, then doing all logging configuration by having right .jar and .properties/.xml files.
What are the reasons to use or not to use slf4j by default in any project?
In this particular case, log4j will actually doing the logging (some to file, some to stdout, some to database), and it is a maven project.
I’m hoping for simple “yeah, go for it” or “no, using slf4j is asking for trouble X” from somebody with experience.
We have been logging over the
SLF4JAPI for 1.5 years now. Before that we usedlog4jdirectly. Now we usejboss.logging, with alogbackintermezzo and had to change zero lines in our code for all the framework changing.So, go for it 😉