Re: java logging / stdout
- From: Lew <lew@xxxxxxxxxxx>
- Date: Fri, 02 Feb 2007 09:51:42 -0500
lambelly@xxxxxxxxx wrote:
The company I work for uses a really simple java class we wrote for
logging. All it really does is append a given statement to a file.
We've been switching over to log4j for a few different reasons,
primarily because this really simple class is far too simple in a lot
of ways. For instance, it doesn't capture anything written to stdout.
Only errors that are actually captured by one of these simple write
statement in a catch or something. This is fine for most problems.
It'll definitely catch a sql error or something like that. But it
won't catch insidious little problems like java heap errors or some
simple runtime errors. I guess what I'm asking is, does log4j do a
better job at capturing errors that aren't explicitly written by some
sort of write statement in the program, or do I have to do some sort
of bash redirect to capture all errors?
Logging does not capture "errors" (by which I assume you mean all java.lang.Throwables). "try-catch" catches Throwables.
Other errors are caught by diligence.
Logging only reports events. It only reports what the programmer tells it to report. In fact, it only logs the messages explicitly passed to the logging API.
You need to catch the Throwables. Then you write log statements to report those events so that maintenance can observe, and if needed repair the conditions.
Nothing will catch "insidious little problems" unless you trap them explicitly.
- Lew
.
- Follow-Ups:
- Re: java logging / stdout
- From: Alex Hunsley
- Re: java logging / stdout
- References:
- java logging / stdout
- From: lambelly
- java logging / stdout
- Prev by Date: Re: question about assigning null to a reference object
- Next by Date: Re: question about assigning null to a reference object
- Previous by thread: java logging / stdout
- Next by thread: Re: java logging / stdout
- Index(es):
Relevant Pages
|
Loading