[ https://issues.apache.org/jira/browse/MAHOUT-52?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12596197#action_12596197 ]
Lukas Vlcek commented on MAHOUT-52: ----------------------------------- I am not a commiter so you can totaly ignore my comment especially when it comes to logging frameworks war. Anyway, my ignorant comments: Logging IS IMPORTANT because in most cases it is the only way how to get useful information when it comes to bug hunting. You should not underestimate this and your choice should not be driven by bad examples (does learning from project which uses three different logging approaches make sense?!). Performance of logging framework DOES MATTER! Ease of use as well. Do you want the developer to be responsible for checking if logging level is enabled? > if (log.isDebugEnabled()) {log.debug("blah..." + localVariable)} // do you > always check if level is enabled? Do you want the developer to effectively think about construction of logging messages? > log.debug("Now it is " + new java.util.Date() + " and this is " + i + " > iteration"); // obviously bad example If I could vote, I would pick SLF4J. Not only it is flexible (JCM is flexible enough as well I think) but it can give you a performance boost with no higher coding effort. Also read this: http://radio.weblogs.com/0122027/2003/08/15.html about when it is not good practice to use JCM. Is having one or two more jar files really a big problem? Why Mahout couldn't be a project with good (and innovative) logging coding standards? Delivering of unit tests with every new piece of code is de facto standard - why not to require also high quality in using logging system as well? Think about this - it is not a minor matter. > Standardize on java.util.logging, Commons Logging, log4j? > --------------------------------------------------------- > > Key: MAHOUT-52 > URL: https://issues.apache.org/jira/browse/MAHOUT-52 > Project: Mahout > Issue Type: Improvement > Reporter: Sean Owen > Priority: Minor > > I see the log4j and Commons Logging .jars in the lib/ directory. log4j isn't > used; Commons Logging is used in one class (Parametered). My code just used > java.util.logging directly. > I figure we should standardize on one approach to logging. I personally think > they're all just about the same; the only real best practice is using one > system. > I have always just used java.util.logging since it is built into Java 1.4+. > Commons Logging offers an extra layer of abstraction and lets you switch > between java.util.logging and log4j underneath. That's cool, but I've not > found it compelling enough to want to add another layer and another .jar file. > But, I guess log4j is present because hadoop uses it directly? The .jar seems > to have a dependency on it. > In that case maybe we are better off using Commons Logging to let us > integrate with log4j logging that Hadoop uses, and leave open the possibility > of other callers using java.util.logging underneath. > If that's cool I can switch my code to use Commons Logging. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.