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
posted
0
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
posted
0
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>
SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
K Huang
Ranch Hand
Joined: Dec 12, 2002
Posts: 55
posted
0
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
posted
0
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
posted
0
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.
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
posted
0
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
posted
0
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 ?