Do errors that are printed with System.err.println() get logged
somewhere when a deployed application is running? If so, where can I
find that log file?
Thanks!
Steve W. Jackson - 08 Feb 2006 22:31 GMT
> Do errors that are printed with System.err.println() get logged
> somewhere when a deployed application is running? If so, where can I
> find that log file?
>
> Thanks!
Depends on what you mean by "deployed application". If it's a
standalone application, it's only redirected if you do it yourself. If
you mean, for instance, something deployed in an app server or
container, then it should end up in that program's output logs. I know
that my web service, when running in Tomcat, sends its err and out to
Tomcat's own logs.
= Steve =

Signature
Steve W. Jackson
Montgomery, Alabama
TheVooDooChild - 09 Feb 2006 12:52 GMT
Yes Steve, it is deployed to an app server, Weblogic. I'll see what
logs if any I can find created from Weblogic.
Thanks!
stephanwehner@gmail.com - 09 Feb 2006 01:01 GMT
You can do stuff like this if can't manipulate the stderr "from
outside"
and have access to the source.
System.setErr(new java.io.PrintStream(new
java.io.FileOutputStream("/tmp/mystderr")));
System.err.println("Hello"); // example. Hello should appear in
/tmp/mystderr file.
See you
Stephan
__________________
Stephan Wehner
http://stephan.sugarmotor.org
Roedy Green - 09 Feb 2006 04:06 GMT
On 8 Feb 2006 13:33:46 -0800, "TheVooDooChild"
<mikelsmith@hotmail.com> wrote, quoted or indirectly quoted someone
who said :
>Do errors that are printed with System.err.println() get logged
>somewhere when a deployed application is running? If so, where can I
>find that log file?
no. But you can redirect them to a log or Tee them to go both to a log
and the console.
see http://mindprod.com/jgloss/console.html#REDIRECTION

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Oliver Wong - 09 Feb 2006 18:09 GMT
> Do errors that are printed with System.err.println() get logged
> somewhere when a deployed application is running? If so, where can I
> find that log file?
While it's possible to set up such a logging system yourself, Java
doesn't do any logging automatically for you.
If you want to modify your Java program to make logging easier, replace
your calls to System.err.println() with calls to the appropriate method of
the "Logger" class:
http://java.sun.com/j2se/1.5.0/docs/api/java/util/logging/Logger.html
- Oliver