MIDRANGE dot COM Mailing List Archive



Home » JAVA400-L » February 2008

Re: log4j on the '400



fixed

Glenn Holmer skrev den 04-02-2008 15:06:
We've some Java programs that run on a '400 and manually write log
files. Has anybody used log4j with programs running on the '400? I
suppose you'd put the log file in the IFS?
Yes, we have used it quite a lot. I wrote an adapter that wrapped so that output would fit in the width of the spool file.

I would strongly suggest you write your code using slf4j so you postpone your choice of logging framework from runtime to deploy time. It is very simple to use.

Note that for long running programs you would want a mechanism that can tell your logging framework to reload its configuration - log4j does not have such a thing, and it is rather tedious to restart an application to pick up a small logging change.

I have found the logs from java.util.logging (which is not available in 1.3) to be more helpful - they can tell the name of the method where the log call is made.

A few tips from the trenches: When dealing with an exception ALWAYS include it in the log message. If you throw a new exception include the old one in the new exception - never just throw it away. When logging fatals, make the logging framework sound the alarm (send mail, trigger instant messenger).






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact