?
Solved

What is the benefit of logging libraries?

Posted on 2014-12-03
3
Medium Priority
?
158 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 28

Accepted Solution

by:
dpearson earned 1000 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 1000 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

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

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

This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
In this article I discuss my selections of the Top Four free Outlook OST File Viewers available. Open, view and read even damaged OST files by using these tools. They all provide a clear preview of all data such as emails, notes, tasks, calendars, e…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.
Suggested Courses

777 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