473,508 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Log4j vs Java.utils.logging

myusernotyours
188 New Member
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 2691
itsraghz
127 New Member
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 New Member
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 Recognized Expert MVP
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 New Member
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 New Member
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
180310
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
7891
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
3251
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
14787
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
2150
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
7414
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
1983
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
5506
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
4098
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
7115
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
7321
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,...
0
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7489
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5624
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
414
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.