× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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).


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.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 on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.