Log4j vs Java.utils.logging

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • myusernotyours
    New Member
    • Nov 2007
    • 188

    Log4j vs Java.utils.logging

    Hi all,

    I have scoured the net for this opinion, and I have come to the conclusion that many think log4j is the superior API. I therefore would like to hear the opinion of you guys here at bytes.

    For me, I haven't done much logging but I have tried the Sun API and Log4j and I am starting to think Log4j is superior.

    What do you guys think?

    Regards,

    Alex.
  • itsraghz
    New Member
    • Mar 2007
    • 124

    #2
    Is your question about "which came first into existence"? Log4j was in existence in JDK 1.1 whereas java.util.loggi ng was in place only since JDK 1.4.

    The reference url says the same -> http://logging.apache.org/log4j/1.2/faq.html#1.3

    If not, are you asking "which is the best?" -- they both are having their own ways of dealing with it.

    Though log4j is being used by many people as it got many significant features which the other does NOT provide, it is a separate library from Apache, whereas java.util.loggi ng has been implicit and internal to the JDK you use.No other library is required.

    Comment

    • myusernotyours
      New Member
      • Nov 2007
      • 188

      #3
      Originally posted by itsraghz
      Is your question about "which came first into existence"? Log4j was in existence in JDK 1.1 whereas java.util.loggi ng was in place only since JDK 1.4.

      The reference url says the same -> http://logging.apache.org/log4j/1.2/faq.html#1.3

      If not, are you asking "which is the best?" -- they both are having their own ways of dealing with it.

      Though log4j is being used by many people as it got many significant features which the other does NOT provide, it is a separate library from Apache, whereas java.util.loggi ng has been implicit and internal to the JDK you use.No other library is required.

      I just wanted to get a comparison of the two APIs from members. Not exactly a "this is best" comparison. - Not a black and white kind of thing but just... Why would you choose one over the other? In the event you were asked to recommend?

      Regards,

      Alex.

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        I once picked Log4J over Sun's implementation for one reason: the RotatingFileApp ender:
        Sun's implementation didn't (and still doesn't) have it and I needed it and I was
        too lazy to implement my own version.

        kind regards,

        Jos

        Comment

        • itsraghz
          New Member
          • Mar 2007
          • 124

          #5
          Originally posted by JosAH
          I once picked Log4J over Sun's implementation for one reason: the RotatingFileApp ender:
          Sun's implementation didn't (and still doesn't) have it and I needed it and I was
          too lazy to implement my own version.

          kind regards,

          Jos
          I second it though I dint face the scenario !

          Comment

          • myusernotyours
            New Member
            • Nov 2007
            • 188

            #6
            Originally posted by JosAH
            I once picked Log4J over Sun's implementation for one reason: the RotatingFileApp ender:
            Sun's implementation didn't (and still doesn't) have it and I needed it and I was
            too lazy to implement my own version.

            kind regards,

            Jos
            Also I find the log Levels in log4j nicely intuitive. Those in sun's impl are not the best to deal with. For example deciding whether a given message is Level Fine, Finer, or Finest can be a pain. The level Debug in Log4j is well... Just that. DEBUG!

            And Jos... I never thought Sun would be as lazy as you!!!! ;-)

            Regards,

            Alex.

            Comment

            Working...