Popularity of log frameworks
Posted by Mike Haller
on Tuesday, May 4. 2010
at 08:43
in Java
Logging is some weird kind of aspect of software development. It's a necessary evil so to say. On the one hand, it's great to have the flexibility to either log in a file or to console, to roll the files, to enable certain log statements at runtime etc. But on the other hand, there are so many logging frameworks and so manyof them did wrong in their first encounter, it became quiet insane.A few years ago, driven by the well-known problems of commons-logging, we've switched over to slf4j with log4j as engine. I don't regret that, as I like the slf4j-api and modularized design. I also kind of like log4j - its log4j.xml, its debug system parameters and that its practically spread all over the Java world. Yes, sure, there are some minor drawbacks, like the inability of the log4j committers to provide clean Maven pom.xml files for some version. Did they fix that btw?
Anyway, to cut a long story short: i've played around with Neo4j and Maven and came up with a quick Maven Repository scanner which counts the dependencies from reverse: it shows how often a certain artifact is referenced by another project as dependency. The data basis was my local repository (11988 artifacts) and it's surely biased to some degree. I'll try to get a clean Maven Repo mirror some day and rerun the experiment.
The winner is:
1162 times used (9,69%): org.slf4j
867 times used (7,23%): log4j
837 times used (6,98%): commons-logging
There is other interesting information in that experiment, like
20,33% of the artifacts are using junit, thereas 1,9% use testng. 21,13% use the Spring Framework and 6,45% of all the Maven artifacts in my repo use the javax.servlet spec. Easymock is used by 5,62% of the artifacts. Other popular libraries include com.sun.xml.bind, commons-lang, asm, Xerces, Apache Camel, Jetty, javax.xml.bind, javax.xml.soap, wsdl4j, commons-collections, Ant, Apache Cocoon, Apache Abdera, org.eclipse, commons-io, cglib, hibernate, velocity, woodstox and derby.
