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