File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes stdout -- simple logging Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "stdout -- simple logging" Watch "stdout -- simple logging" New topic
Author

stdout -- simple logging

vianyrajnish rajnish
Ranch Hand

Joined: Apr 22, 2007
Posts: 70
hi all,

i am newbie to tomcat usage ...

i want to know how can i see the system.out.println debugging messages

at default stdout file under the log folder


vinay rajnish
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39543
    
  27
Output from System.out.println should end up in the %TOMCAT_HOME%/logs/catalina.out - is that not the case?


Ping & DNS - updated with new look and Ping home screen widget
vianyrajnish rajnish
Ranch Hand

Joined: Apr 22, 2007
Posts: 70
hi ,

i am finding only these text files

localhost_log.2007-08-01
stderr
stdout

or else can you tell me where the setting are made
to output debug messages to text file like stdout(or catalina.out)
in tomcat.

thanks,
vinay rajnish
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39543
    
  27
Does one of the files you listed contain System.out output?
vianyrajnish rajnish
Ranch Hand

Joined: Apr 22, 2007
Posts: 70
hi,


No its does not contain the System.out.println ... outputs.

The outputs should come to catalina.out or the stdout ( in my case).

the problem occurs when i deleted all the contents of stdout .. so that i can see the new log results when i run freshly ...

is that creates any problem?... thats why i trying to find the root cause for this problem .. by looking at the configuration made in tomcat to direct these results...

do you know where it is configured.. in tomcat?

Vinay Rajnish
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
I have not come across any configuration , but see my System.out.print statements in catalina.out file.
In case you are starting tomcat by clicking the bat files it appears in the console.


Rahul Bhattacharjee
LinkedIn - Blog
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Which file they go to, depends on your version of Tomcat and how it was installed but the log will always be in TOMCAT-INSTALL/logs.

If you're running Tomcat on Windows and starting from the batch scripts, it may, (again, depending on the version) send the output to the console instead of logging it.

Personally, I stopped using System.out.println a long time ago and went with log4j. Doing so has given me much more control over how logging is performed in both the development and production environments.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Princy Mathew
Greenhorn

Joined: Sep 11, 2007
Posts: 6
Those who are seeing the System.out.println output in catalina.out ,can you please tell me which version of tomcat you are using

Thanks
princy
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Princy Mathew:
Those who are seeing the System.out.println output in catalina.out ,can you please tell me which version of tomcat you are using

Thanks
princy


Why don't you tell us what version you are using.
Also tell us how you are starting Tomcat.
I'm guessing it's as a Windows service (which usually results in the localhost_log.2007-08-01 files you mentioned earlier).
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

By the way, the best thing I've ever done, logging wise, is to replace every single System.out.println statement in my app with log4j statements. I now have complete control over where my logging takes place and can tune the logging level while my app is running.

I'll never use System.out.println in a web app again.
Princy Mathew
Greenhorn

Joined: Sep 11, 2007
Posts: 6
Hi I am using tomcat 5.0 and I start the tomcat using startup.bat in windows.

I got an information that only if we start the tomcat as a service in the "Control Panel" ,the logs will be written to catalina.out .please see http://deegree.sourceforge.net/inf/troubleshooting.html

Can any one tell me how to start the tomcat as a service in the control panel.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: stdout -- simple logging
 
Similar Threads
Problem retrieving data from the database using hibernate
Cannot create Local Session Bean in JBoss 4.0.3 ?
no object DCH for MIME type text/plain; charset=us-ascii
shell redirection
FacesContext is null inside managed bean