By alan_125
via jnassef.blogspot.com
Published: Sep 04 2008 / 23:43
All of us know that decoupling your code from the frameworks you use is a really great thing. Just imagine how much code you will be changing if you are using log4j APIs in all of you application classes, and then a decision was made to start using the java APIs instead. Think of how much code would be changed. But with commons logging, the code changes would be minimal. This must mean that commons logging is a good thing, right? WRONG!
Comments
zynasis replied ago:
shameless SLF4J promotion
alan_125 replied ago:
Actually this wasn't my point. I was trying to show the negative points of JCL that are not there in SLF4J. SLF4J has its share of negative points as well (not using Java 5 varargs for parametrized logging, internationalization and using resource bundles are a few). The thing I wanted to stress on is the problems with the class loading, with its bugs and performance overhead.
hammingweight replied ago:
This is a distinctly negative post; I would have preferred the emphasis to be pro-slf4j rather than this anti commons-logging rant.
alan_125 replied ago:
I agree, but as I mentioned in my previous reply, the idea was discussing the problems with JCL's class loading, not how great SLF4J is.
Stefan Fussenegger replied ago:
way too much words to make a simple point
alan_125 replied ago:
This is one of my worst features. I'll try to be less talkative :)
William Louth replied ago:
This is like saying that a particular cigarette brand is bad for your health. Logging is bad for your health no matter what the brand. Just stop.
Lets have more events (CEP please) and dynamic state management and less stringified records.
alan_125 replied ago:
I totally disagree with that. For small applications that are used for fun, you might be correct, but for large enterprise applications, this is totally wrong. For banking, brokerage, telecommunications, etc. logging is one of the most important aspects of any application.
sproketboy replied ago:
SLF4J sucks for one simple reason. It's yet another wheel reinvention. Yes commons-logging sucks too which is why most people simply switched to log4j.
Sun should just stick javax in front of the log4j package and be done with it.
alan_125 replied ago:
I agree that putting another layer in your application is bad for performance, but abstraction is important too. If you tie yourself to a specific framework, this is really bad. Log4J is a great framework, but I discovered that logback for instance has better performance (I'm going to publish benchmark results soon). If I want to switch from Log4J to Logback, it's going to be a real pain, and the time spent in the migration is going to be huge (and usually not worht it). I wrote an article on abstraction. It's quiet long (I can't control myself typing), but I hope its worth your time. You can find it here: http://www.dzone.com/links/bubble_wrap_hani_suleiman_and_logging_abstraction.html.
Voters For This Link (19)
Voters Against This Link (9)