Solved

What is the benefit of logging libraries?

Posted on 2014-12-03
3
153 Views
Last Modified: 2014-12-04
Hello,

My question is very open ended; basically, why were logging libraries created? For the sake of discussion I'd just like to talk about Java.

What magical things do logging libraries do, that a class with static file objects won't let us do?

Far as I can see, logging libraries are just another dependency in Maven that can cause a build to fail.

I'll admit I'm fairly inexperienced, so I might be missing something obvious... I would be grateful to learn their importance.

Thanks in advance!
0
Comment
Question by:Errang Genevre
3 Comments
 
LVL 26

Accepted Solution

by:
dpearson earned 250 total points
ID: 40480096
The basic ideas behind a logging library are:
 - Support different levels of logging (INFO, ERROR etc.)
 - Support configuration to control what is logged (so you can see just ERROR and then turn it up to DEBUG for details etc.)
 - Separate the code that creates a log from caring where that log is written to (console, file, network stream etc.)
 - Allow logs to be sent to multiple locations without adding multiple log statements (e.g. console and file)
 - Allow filtering so that only certain components are logged in detail, while others are logged at only a high level
 - Do all of this efficiently

Could you build all of that yourself?  Yes of course, but why take the time, just use a library.  They pretty much all support everything above with small differences.

Hope that helps,

Doug
0
 
LVL 37

Assisted Solution

by:Neil Russell
Neil Russell earned 250 total points
ID: 40480177
They serve the same purpose as any other Library.  They give you a standard, tried and tested, set of functions that will perform the same task wherever you use it with minimal coding from you.

Do you use a database? Yes we all do, did you write the database every time you want to use one? No of course not, you use a standard database backend that has a standard method of connecting to it.  Same thing.

It saves time and effort.

"....that can cause a build to fail"   Really? Then you are doing something else wrong and maybe that is what you should be addressing OR you are using a library hat is not robust or fit for purpose.
0
 

Author Closing Comment

by:Errang Genevre
ID: 40480567
Thanks, it's not related to a project I'm working on now; those libraries usually failed for me in the past. And I just thought they were overkill.

But yes, I'll have to accept the argument for consistency.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Java - Why doesn't this JFrame work 3 45
suggestion for PC desktop software to send PayPal mass payments 2 35
object oriented programming comparison 5 57
oracle 11g 23 51
Let’s list some of the technologies that enable smooth teleworking. 
In our personal lives, we have well-designed consumer apps to delight us and make even the most complex transactions simple. Many enterprise applications, however, are a bit behind the times. For an enterprise app to be successful in today's tech wo…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now