Those of you who haven’t used System.out.println(“My variable: ” + myVariable) in some Java classes to get debug information to the console, raise your hands please. None? ;-)
I am very fond of logging as a complement to debugging, since I can “trace” actions in my programs even if the classes is in production. “But hey, logging makes the application go slower!” you might think. Well, it’s up to you to decide, a small performance hit is likely to occur, a big hit if you don’t read the documentation of for instance the PatternLayout.
I use Log4j a lot in the Java code I design and write, and haven’t noticed any big difference between logging and not logging.
So, you might have used Log4j a bit and used Chainsaw to look at Log4j logging files. Why not look at the logging in realtime? Here is how to do it.
Continue reading