Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

Tomcat 4.1.24 configuration on windows

I installed Tomcat4.1.24 on windows, how can I configure my tomcat so my Java application debug information will be stored in a log file? e.g. all messages outputed from "System.out" or "System.err" will be stored.

Thanks in advance.
0
victorli
Asked:
victorli
  • 3
  • 2
  • 2
  • +4
1 Solution
 
thanassisCommented:
Tomcat puts its log files in the directory tomcat/logs. Servlet invocations are stored in servlet.log and JSP pages are logged in jasper.log. These files can be very helpful when debugging your applications.
0
 
zerg2000Commented:
Hi thanassis,

Could you please tell us how to configure the Tomcat such that output from System.out.println() in application classes will redirect to the log file instead of command console (defaut)?

Thanks
0
 
thanassisCommented:
Hi zerg2000,

Do you know about "catalina.out" file?
This is where you have to look for applicaiton logs.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
cheekycjCommented:
Unless tomcat does it differently but servlet engines usually automatically redirect System.out to their stdout.log file or in this case it seems to be the catalina.out file.

CJ
0
 
victorliAuthor Commented:
Hi all, thanks for your reply.

Usually I did development using Tomcat running on Linux and I have no problem with that, from Tomcat 4.0.1 to Tomcat 4.1.24, the application debuging information will go to "catalina.out" which is located in "../logs".

BUT, in Windows version of Tomcat 4.1.24, the "catalina.out" does not exist!!!

>Servlet invocations are stored in servlet.log and JSP pages are logged in jasper.log.
I suppose this is from the documentation but I can not find where the "server.log" and "jasper.log" is.

Maybe we need to configure the "server.xml" e.g. put "org.apache.catalina.logger.SystemOutLogger" to somewhere , but not sure.
0
 
victorliAuthor Commented:
When starting Tomcat in Windows, a console window will pop up and the information displayed in this window looks like exactly the same as the "catalina.out" in Linux. But after you shutdown then restart the Tomcat, the previous message was gone. It is not persistent and I can not find which file this informat stored or only stored in memory?
0
 
cheekycjCommented:
if you run tomcat as a service it will put stdout in a log (I think tomcat.log)

or try this:
/some/dir/tomcat/bin/startup.sh 2>errfile >outputfile

Where
errfile = path and filename of error file
outputfile = path and filename of standard output file

read the last thing on deja.

CJ
0
 
victorliAuthor Commented:
Hi CJ, thanks for your help.

But I can't find "tomcat.log" either.

Can "startup.sh" run under Windows? I suppose it is for running on Linux/UNix.

Help please.
0
 
kennethxuCommented:
not tried myself, but I know new version of tomcat use jakarta common log. you need to check out the common log documentation in order to change tomcat logging behavior.
0
 
girionisCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- To be PAQed and points NOT refunded.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer
0
 
GhostModCommented:
PAQed, with points refunded (75)

GhostMod
Community Support Moderator
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now