Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

System.err.println

Thread view: 
TheVooDooChild - 08 Feb 2006 21:33 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!
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.