Solved

What is the benefit of logging libraries?

Posted on 2014-12-03
3
155 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 27

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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Html Table Looping (part 2) 5 35
What program can open a .sig file image? 6 80
Software for Local History Museum Library 5 73
How to fix  socket closed error 11 33
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
This article was originally published on Monitis Blog, you can check it  here . If you have responsibility for software in production, I bet you’d like to know more about it. I don’t mean that you’d like an extra peek into the bowels of the sour…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

696 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