Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

stdout -- simple logging

 
vianyrajnish rajnish
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Output from System.out.println should end up in the %TOMCAT_HOME%/logs/catalina.out - is that not the case?
 
vianyrajnish rajnish
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does one of the files you listed contain System.out output?
 
vianyrajnish rajnish
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Princy Mathew
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic