logging : Java Glossary


Dumping out information as a program proceeds to a file. It may be a log of transactions, debugging information or raw material for statistics. This sounds like something mindless that could be entirely handled with println, but by adding sufficient bells and whistles it becomes an entire package unto itself. For example, you control at runtime which logging information you want included using the LogManager class and a configuration file. You have multiple log files, that cycle rather than one big one.

There are logging classes built into Java 1.4+. Here is how you use them:

Log4J allows channels to stream different classes of messages to different files, and to configure logging behaviour after the code is compiled on a very fine granularity.

Instead of peppering your code with debugging println statements that you remove entirely when you find the bug, with logging you leave the logging/generic debug instrumentation code in place and turn it on and off, in different parts of the program, to varying degrees of detail, at run time, without having to recompile. You normally leave at least a minimum amount of the logging engaged even in production to help track down trouble and to produce statistics.

Normally small project would not use a formal logging package, but almost any team project will be fitted with a logger.

Learning More

Oracle’s Javadoc on Logger class : available:
Oracle’s Javadoc on FileHandler class : available:
Oracle’s Javadoc on Level class : available:
Oracle’s Javadoc on SimpleFormatter class : available:
Oracle’s Javadoc on LogManager class : available:


book cover recommend book⇒The Complete Manual log4jto book home
by Ceki Gülcü 978-2-97003690-6 paperback
publisher QOS.ch
published 2003-05-07
The author is the creator of Log4J.
Australian flag abe books anz abe books.ca Canadian flag
German flag abe books.de amazon.ca Canadian flag
German flag amazon.de Chapters Indigo Canadian flag
Spanish flag amazon.es Chapters Indigo eBooks Canadian flag
Spanish flag iberlibro.com abe books.com American flag
French flag abe books.fr amazon.com American flag
French flag amazon.fr Barnes & Noble American flag
Italian flag abe books.it Nook at Barnes & Noble American flag
Italian flag amazon.it Kobo American flag
India flag junglee.com Google play American flag
UK flag abe books.co.uk O’Reilly Safari American flag
UK flag amazon.co.uk Powells American flag
UN flag other stores

This page is posted
on the web at:


Optional Replicator mirror
of mindprod.com
on local hard disk J:

Canadian Mind Products

Your face IP:[]
You are visitor number