aspose file tools*
The moose likes Other Open Source Projects and the fly likes log4j vs J2SE1.4 log Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "log4j vs J2SE1.4 log" Watch "log4j vs J2SE1.4 log" New topic
Author

log4j vs J2SE1.4 log

K Huang
Ranch Hand

Joined: Dec 12, 2002
Posts: 55
I just started learning log. In Jakarta common logging, u can choose which logging to use.
log4j is very popular, but java 1.4 has log too. I am wondering log4j has no future.
What is your opinion ?
Mike Farnham
Ranch Hand

Joined: Sep 25, 2001
Posts: 76
Jim,
The apache commons project allows you a choice. So, you can use a single API for your logging.

I believe there is a strong base of log4j users since it was established before the JDK 1.4 Logging API. I know one of our developers indicated he thought log4j was better.

I would think it will mostly depend on your needs to use the standard consultant answer.

You might check out the book:
"Logging in Java with the JDK 1.4 Logging API and Apache log4j" by Samudra Gupta.

Cheers,
Mike
Brian Sam-Bodden
author
Greenhorn

Joined: Aug 31, 2004
Posts: 25
In my opinion Log4J is a much more mature logging implementation proven in countless applications, both J2SE and J2EE applications. As with anything created by committe I think the J2SE logging lacks a lot of the features that appear in an API from extensive usage in heterogenous environments. I personally use Commons Logging usually fronting Log4J. For J2SE apps I sometimes use the J2SE logging but never for J2EE applications.

Brian


Co-Author of <a href="http://www.amazon.com/exec/obidos/ASIN/1590591259/ref=jranch-20" target="_blank" rel="nofollow">Enterprise Java Development on a Budget</a>
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
http://www.ingrid.org/jajakarta/log4j/jakarta-log4j-1.1.3/docs/critique.html


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
K Huang
Ranch Hand

Joined: Dec 12, 2002
Posts: 55
Thanks for all your reply !
No wonder log4j is still so popular even though 1.4 has log too.
Scott Duncan
Ranch Hand

Joined: Nov 01, 2002
Posts: 363
I found the 1.4 implementation to be decent but limited when compared to log4j. Plus, although it's been a while, I thought it was hard to find decent documentation but that may have changed by now. My organization has quite a few apps that use commons logging and/or log4j. Both, in my opinion are better that the current Sun implementation.


No more rhymes! I mean it!<br /> <br />Does anybody want a peanut?
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I would be perfectly satisfied with JDK Logging API if only they had included a facility similar to Log4J's DailyRollingFileAppender. I can't believe they didn't include a date-based rolling file appender even though they did include a file size-based one. Sigh.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Christopher Judd
author
Greenhorn

Joined: Aug 24, 2004
Posts: 27
I have done performance tests between the two and determined Log4j was about 10% faster then J2SE Logging.

I always front logging with commons logging but I especially like to do it with J2SE because fine, finer finest is to ambiguous.


Co-Author of <a href="http://www.amazon.com/exec/obidos/ASIN/1590591259/ref=jranch-20" target="_blank" rel="nofollow">Enterprise Java Development on a Budget</a>
K Huang
Ranch Hand

Joined: Dec 12, 2002
Posts: 55
Thanks for all your reply !
How do u guys learn log4j before any book is available ? Just by Apache on line documents ? I tried Apache on line documents for Struts, Commons(Pool, DBCP) before. I have to say I am not smart enough to learn well by those free document.
This new book is an overall introduction, not for learning a specific technologies. I am wondering if I can read this book for a general idea and learn each specific item by on-line document ?
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Originally posted by Christopher Judd:
I have done performance tests between the two and determined Log4j was about 10% faster then J2SE Logging.

I always front logging with commons logging but I especially like to do it with J2SE because fine, finer finest is to ambiguous.


How to testing performance between J2SDK Logging API and Log4j ?
Christopher Judd
author
Greenhorn

Joined: Aug 24, 2004
Posts: 27
I recommend you start with the article Building Flexible Logs With log4j by Vikram Goyal
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
I'm study log4j from document on line base on Apache website and another website such as forum at http://www.javaranch.com, http://www.onjava.com ... etc.

And i'm read some book about Log4j, you can see more book at amazon.com.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: log4j vs J2SE1.4 log