Solved

What is the benefit of logging libraries?

Posted on 2014-12-03
3
148 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

762 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

6 Experts available now in Live!

Get 1:1 Help Now