Posts

Showing posts from December, 2013

2014 Logging Frameworks You Would Like to Work With

In my previous post I have given an overview about Java's logging state as of January 2014 In this post I want to recommend which libraries to use for your java project. Main Logging Frameworks Most notable frameworks in this section include:  Java Util Logging ,  Log4j ,  Logback ,  Log4j2 I will go over them one by one: Java Util Logging  - This is Java's official logging framework it has been there since 2002 and is mostly copied from log4j which have released their library two years before (2000). no significant updates have been released to the Java logging component and it is mostly abandoned (although it still resides in the rt.jar core java files), the brave developers who had tried using it report a complicated logging framework which needs a good overhaul and the general advice is to stay away from it! Log4j  - No need to introduce Log4j which is the most used logging framework, and is with us for over 14 years!, log4j is a very robust framework,

2014 Overview of Logging in Java

Why do you even need a logging framework [In a nutshell] ? Logging severity (Debug / Info / Error etc) Different loggers for different tasks Logging configuration in a single XML instead of all over your application Lots of other reasons Sorry, it is so obvious to me that I can't elaborate here any further What sorts of logging components are there ? Main Logging frameworks (use these to do the actual logging [log4j, logback etc]) Logging APIs (Facade): Due to several different logging frameworks, a need for a unified API has risen, and of course now there are several different "unified" APIs. Logging Parsers : Components which enable us to read log streams (files, socket etc) conveniently as well as introduce advanced searching & filtering within the log files Main Logging Frameworks The main logging frameworks is what people usually refer to when talking about in app logging, and I suggest a rough division in this department: Robust