java Logger vs. Log4J

Discussion in 'Java' started by Sideswipe, Oct 6, 2007.

  1. Sideswipe

    Sideswipe Guest

    So, I was adding come code for a logger to my stuff and my editor
    offered me a selection of loggers. Since this is my first time with
    1.5 I was surprised to see that there was a built in logging mechanism
    in Java5.

    So, then it brought me to the question of which is better? I noticed
    that log4j has many more logger output destinations than the sun one.
    Which means out-of-the-box usage is fast. But, since it's part of the
    JDK, SUNs logger has no dependencies

    Sun was so late with a logging platform I fear they may have lost out
    to log4j.

    Any thoughts?

    Christian Bongiorno
    http://christian.bongiorno.org
    Sideswipe, Oct 6, 2007
    #1
    1. Advertising

  2. Sideswipe wrote:
    > So, I was adding come code for a logger to my stuff and my editor
    > offered me a selection of loggers. Since this is my first time with
    > 1.5 I was surprised to see that there was a built in logging mechanism
    > in Java5.
    >
    > So, then it brought me to the question of which is better? I noticed
    > that log4j has many more logger output destinations than the sun one.
    > Which means out-of-the-box usage is fast. But, since it's part of the
    > JDK, SUNs logger has no dependencies
    >
    > Sun was so late with a logging platform I fear they may have lost out
    > to log4j.
    >
    > Any thoughts?


    I would use java.util.logging for a JSE desktop app. No need for
    an extra jar and the logging requirements are probably not
    that sophisticated.

    I would use log4j for a JEE server app. The chances are >95% that
    log4j will already be there. And performance and support for
    weird logging destinations can be critical.

    Arne
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Oct 6, 2007
    #2
    1. Advertising

  3. Sideswipe wrote:
    > Sun was so late with a logging platform I fear they may have lost out
    > to log4j.


    No I think there are significant bodies of code using both platforms.
    And of course there are then logging wrapper libraries that try to hide
    both of them. So instead of having just one logging platform we have at
    least three. Unfortunately neither log4j or java logging is a subset of
    the other.
    Mark Thornton, Oct 7, 2007
    #3
  4. We tried to move from log4j to sun's logging package (just to have one
    package less) but figured out that log4j is much better.

    Zsolt

    "Mark Thornton" <> schrieb im Newsbeitrag
    news:Z_6Oi.21905$...
    > Sideswipe wrote:
    >> Sun was so late with a logging platform I fear they may have lost out
    >> to log4j.

    >
    > No I think there are significant bodies of code using both platforms. And
    > of course there are then logging wrapper libraries that try to hide both
    > of them. So instead of having just one logging platform we have at least
    > three. Unfortunately neither log4j or java logging is a subset of the
    > other.
    Zsolt Koppany, Oct 8, 2007
    #4
  5. Sideswipe

    Karl Uppiano Guest

    "Zsolt Koppany" <> wrote in message
    news:feciv1$342$03$-online.com...
    > We tried to move from log4j to sun's logging package (just to have one
    > package less) but figured out that log4j is much better.


    It seems to be a bit of a religious issue around my workplace. Fortunately,
    it is relatively easy to switch between one and the other, the API is
    similar. I tend to prefer the self-contained aspect of using JUL
    (java.util.logging) as opposed to having to drag in a third party jar just
    to do logging.
    Karl Uppiano, Oct 8, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joerg Lensing
    Replies:
    2
    Views:
    20,948
    Simon Niederberger
    Feb 12, 2004
  2. Tony Lockyer

    Java Logger vs Log4J

    Tony Lockyer, Jul 26, 2004, in forum: Java
    Replies:
    1
    Views:
    1,389
  3. sachin
    Replies:
    1
    Views:
    944
    Soren Kuula
    Feb 3, 2006
  4. cap
    Replies:
    3
    Views:
    271
    James Edward Gray II
    Dec 11, 2005
  5. Georges Ko
    Replies:
    4
    Views:
    258
    Georges Ko
    Jul 26, 2006
Loading...

Share This Page