473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Log4j vs Java.utils.logging

myusernotyours
188 100+
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.
Nov 7 '08 #1
5 2686
itsraghz
127 100+
Is your question about "which came first into existence"? Log4j was in existence in JDK 1.1 whereas java.util.logging 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.logging has been implicit and internal to the JDK you use.No other library is required.
Nov 7 '08 #2
myusernotyours
188 100+
Is your question about "which came first into existence"? Log4j was in existence in JDK 1.1 whereas java.util.logging 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.logging 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.
Nov 7 '08 #3
JosAH
11,448 Expert 8TB
I once picked Log4J over Sun's implementation for one reason: the RotatingFileAppender:
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
Nov 7 '08 #4
itsraghz
127 100+
I once picked Log4J over Sun's implementation for one reason: the RotatingFileAppender:
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 !
Nov 7 '08 #5
myusernotyours
188 100+
I once picked Log4J over Sun's implementation for one reason: the RotatingFileAppender:
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.
Nov 10 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Aaron Boxer | last post by:
Hello, My application is using a jar file MyJar.jar that uses log4j (I have the latest release of log4j). I have put both MyJar.jar and log4j.jar in a directory in my classpath. I have also...
2
by: Greg Scharlemann | last post by:
I have a various different packages within this web application that I am writing and I am attempting to set up log4j to log directly to a database. So each class is calling just a generic logger:...
4
by: Jan van Mansum | last post by:
Hello group, I have just been trying out the log4j library. As far as I understand the idea is to keep the logging statements in your, even in the release build. However, obviously you wouldn't...
2
by: BobReynolds | last post by:
We use Log4j for all our logging, I want to know why we have to do the following in EVERY class final private static org.apache.log4j.Logger log = LoggerUtil.getLogger(thisClassName.class); ...
0
by: sainiranji | last post by:
Hi All I have diffrent categories in diffrrent logging purpose and all are working fine...but now my requirment is to disable all at once . The below are change i did for disable all logges...
4
rsrinivasan
by: rsrinivasan | last post by:
Hi, I am using log4j to create log message. I want to write the log message to database. So i configured the log4j.properties files like this... # Database Configuration...
2
by: Hari2349 | last post by:
Regarding to log4j in java program..Plz help me... -------------------------------------------------------------------------------- Hai, friends i used the log4j.properties file like as...
1
by: Kedar Kachare | last post by:
How to use Log4j to create log files using file appender in a Servlet? Also, how to make that Servlet read the log4j.properties file? I have tried following: My web.xml( I use Eclipse europa)...
5
by: Abhinay | last post by:
Hi there, I am working on server which used thread pool to process each client request by separate dedicated thread. My intention was each thread ( of thread pool ) have its own logger and hence...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.