Re: java logging / stdout



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
.



Relevant Pages

  • RE: question about ISA server
    ... There are several logging options in ISA ... In the ISA management console..under monitoring configurations ... ... Summary reports include a set of reports that illustrate network traffic ... All packets that pass through Microsoft Internet Security and Acceleration ...
    (microsoft.public.isa.enterprise)
  • Re: Best way to enable logs to catch a suspicious spammer inside org
    ... >>I received reports that somebody is sending spam from inside my ... >>the suspect belongs to my IP address range in one of my workstation ... SMTP logging wouldn't help much. ...
    (microsoft.public.win2000.security)
  • Error loading log4j properties file
    ... I am using log4j for logging, ... HOWEVER, if I restart tomcat, everything works fine, I get no errors, ... log4j:ERROR Could not read configuration file from URL ... log4j:WARN Please initialize the log4j system properly. ...
    (comp.lang.java.programmer)
  • Logging APIs
    ... I'm familiar with Log4J, I've read about Java 1.4 Logging, used ... Commons logging to sit on top of Log4J (and read an interesting ... the Avalon logging API. ...
    (comp.lang.java.programmer)
  • log4j vs. java 1.4 logging performance
    ... but OptimizeIt (Borland's code profiler) complains that ... log4j is creating too many strings. ... This problem occurs when I turn logging ...
    (comp.lang.java.programmer)

Loading