You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "Sean Owen (JIRA)" <ji...@apache.org> on 2008/05/12 00:11:55 UTC

[jira] Commented: (MAHOUT-52) Standardize on java.util.logging, Commons Logging, log4j?

    [ https://issues.apache.org/jira/browse/MAHOUT-52?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595942#action_12595942 ] 

Sean Owen commented on MAHOUT-52:
---------------------------------

(Responding to Grant's email here where he notes some possible issues with commons logging, wonders if we should use log4j of SLF4J)

I looked closer at the Hadoop source and, oh no, it uses all three. Actually, looks like it is mostly commons logging, with a dash of log4j in some places and some java.util.logging in the Eclipse integration. So I think the story there is "they use commons logging".

Really, there are issues with commons logging? I wonder what the classloader issue could be, and if it affects us?

So we have that possible strike against it, my preference to not use an extra layer of abstraction too. But Hadoop is using it and it does grant some flexibility.

For the same reason I suppose I am not terribly keen on the idea of SLF4J -- what does a logging system on top of a logging system buy you? there's the flexibility argument, but the same might be said of the more standard commons logging. SLF4J seems less likely to be used, between these two facade systems.

Then we are down to log4j vs. java.util.logging. It's personal taste but I find log4j's code and API ugly, and it's an extra .jar file. Then again java.util.logging has its own bizarrness. They are really about the same, I could go either way. I have a slight preference for java.util.logging because of its de facto status and because I have a couple thousand lines of code that use it already.

Oh boy, a vote? I don't know what the best way is to solve this, but best to do it sooner than later. Right now there are some System.out lines in the code and that's definitely suboptimal.

> 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.


Re: [jira] Commented: (MAHOUT-52) Standardize on java.util.logging, Commons Logging, log4j?

Posted by Grant Ingersoll <gs...@apache.org>.
On May 11, 2008, at 6:11 PM, Sean Owen (JIRA) wrote:

>
>    [ https://issues.apache.org/jira/browse/MAHOUT-52?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595942 
> #action_12595942 ]
>
> Sean Owen commented on MAHOUT-52:
> ---------------------------------
>
> (Responding to Grant's email here where he notes some possible  
> issues with commons logging, wonders if we should use log4j of SLF4J)
>
> I looked closer at the Hadoop source and, oh no, it uses all three.  
> Actually, looks like it is mostly commons logging, with a dash of  
> log4j in some places and some java.util.logging in the Eclipse  
> integration. So I think the story there is "they use commons logging".

OK, if Hadoop uses Commons  then let's just do that, or at least  
that's my vote.