Discussions

General J2EE: Log4J vs Sun Java Logging API

  1. Log4J vs Sun Java Logging API (8 messages)

    Hi,

    What library do you use? Would you please share your expirience? Which API is better in your opinion? Which is more easier to use, extend? Which one has a better design?

    Any other comments are welcomed!

    Mark

    Threaded Messages (8)

  2. Log4J vs Sun Java Logging API[ Go to top ]

    Sun Java Logging API is supported by Sun and will be a part of all future releases of JDK. Log4J has a big fan following and it is equally good. Sticking to what the JDK provides is better sometimes because log4j is to be viewed as a third party plugin to your app.
  3. Log4J is better functionally simply because it has been around for longer. If you use the JDK 1.4 logging API you will not be able to deploy to an earlier JDK.
  4. Log4J vs Sun Java Logging API[ Go to top ]

    \Anil\
    Sticking to what the JDK provides is better sometimes because log4j is to be viewed as a third party plugin to your app.
    \Anil\

    You mean along with the 37 or so other JAR files that I regularly use? :-)

    Personally, I prefer log4j because it has a superior feature set than the JDK logger. Plus the log4j memory footprint is tiny, and it's fast, and it works on any JDK. It'll be a long time before I give log4j up.

        -Mike
  5. Log4j is much better than Sun's logging API, its thread-safe and fast only time you want to use Sun's logging API if you don't want to add external dependency in your project.

    Thanks
    Javin
    10 tips on logging in Java

  6. Log4J vs Sun Java Logging API[ Go to top ]

    Have a look at http://jakarta.apache.org/commons/logging.html . Here is a snippet of its desc:

    [The Logging Wrapper Library component of the Jakarta Commons subproject offers wrappers around an extensible set of concrete logging implementations, so that application code based on it does not need to be modified in order to select a different logging implementation.]
  7. Log4J vs Sun Java Logging API[ Go to top ]

    commons logging provides a facade around a logging framework of choice. so you can code to this open api then switch logging implemntation more easily. You still need to choose between log4j and JDK 1.4 loggin however
  8. Log4J vs Sun Java Logging API[ Go to top ]

    It's only question of short time when log4j will have Sun Logging API interface too. But as other people said, there are many benefits of actual log4j. BTW. It's longer here and tested in many projects by many people.
  9. Found some articles[ Go to top ]

    The following articles might be of interest to you:

    - log4j vs JDK1.4's logging framework
      http://www.ingrid.org/jajakarta/log4j/jakarta-log4j-1.1.3/docs/critique.html

    - Why not to use JCL (A Wrapper for Logging)
      http://www.qos.ch/logging/thinkAgain.html