4 ms·
I only briefly worked in a Java dev shop as an intern, but I remember coming across Apache Commons Logging, and seeing the idea of an abstraction framework for
by IsaacL 14y ago
I only briefly worked in a Java dev shop as an intern, but I remember coming across Apache Commons Logging, and seeing the idea of an abstraction framework for logging frameworks an example of the "architecture astronautism" that infests Java.
However, I do realise that the Java ecosystem is often complex for a reason (or, "simpler" languages and frameworks are often too simple). Is there a reason there are so many logging frameworks? What different needs do they solve?
- exabrial 14y agoNo, there really isn't a need for all of them. SLF4J solves 100% of the problems 95% of the time. The problem is Apache's "Not invented here" syndrom. Commons-logging, Log4j, developers need to just abandon their projects and work on SLF4J. BTW "architecture astronautism" great term. I <3 Java, it has a culture of overengineering, in which I do not participate.
- grobmeier 14y agoslf4j is a facade. It does not do much alone. logback / log4j2 are 2 implementations of the slf4j facade. log4j2 is a community driven project and it is maintained with Apache License 2.0. It addresses some issues of logback. If you run into this issues in production, you can switch to log4j2, given that you are using slf4j (which is the recommendation). commons-logging is pretty dead, and nobody makes a deal about it. It has not been updated for around 5 yrs. You clearly need to understand the difference between slf4j and logback/log4j2. And you should learn more about what the Apache Software Foundation is doing. I consider it better not to trust a single company when it comes to important things. It has often proven in the past.
- bowyakka 14y agoWhilst I am not a fan of the logging pain in java, not invented here would apply to anyone thats not log4j since they were really the first to get properly started.
- bborud 14y agoNobody cares who was first. The right thing to do would have been to focus on getting j.u.l right and then be a grown-up about it and ditch log4j. Apache fucked up and Sun fucked up. And we all lose.
- koko775 14y agoThe creator of slf4j and logback originally created log4j, so "Not Invented Here" is literally not true as the inventor invented those three libraries.