?
Solved

how to return Tomcat server (startup batch file) messages (JSP)

Posted on 2005-03-10
9
Medium Priority
?
222 Views
Last Modified: 2013-11-24
How Can I get the messages in the (startup) and put it into a string.
That is I want to print the trace of messages when I mail.On JSP Page.
 I am able to see that trace on startup batch file by enabling session.setDebug(true).
Now I want to print it on the JSP page.Can Any Body have an Idea.
0
Comment
Question by:kamran
8 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 13515413
You mean something like this?

If not, I don't understand...can you explain more?

<%
    BufferedReader fr = new BufferedReader( new FileReader( "/tomcatinstalldir/logs/catalina.out" ) ) ;
    String line = "" ;
    while( ( line = fr.readLine() ) != null )
    {
        out.print( line ) ;
        out.print( "<br>" ) ;
    }
    fr.close() ;
%>
0
 

Author Comment

by:kamran
ID: 13515996
Problem is that I have hosted the side on linux based server.So I Can't have the directory access where tomcat is install .
Also When I am testing this code locally there is no   (catalina.out) file in the logs
directory.I am using tomcat version 4.
Plese help if you can.  
0
 
LVL 35

Expert Comment

by:TimYates
ID: 13516079
>> Also When I am testing this code locally there is no   (catalina.out) file in the logs directory.

It may have a name based on the name of your webapp...

what files are in there?  And what is the name of your webapp?

>> So I Can't have the directory access where tomcat is install

Not sure you can get round this then :-(
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 6

Expert Comment

by:durgaprasad_j
ID: 13517331
hi,
    if you dont have access to the install dir.. it is not possible to get the messages.

>>>    I am testing this code locally there is no   (catalina.out) file in the logs

           just open the catalina.sh and search for logs/ , then you will find the name of the log file, where it is writing to.

           
0
 
LVL 1

Expert Comment

by:nadhuvi
ID: 13517363
yes,, please follow the suggection by durgaprasad and reading the file catalina.sh will help to indetify the log file name.... it used to be catalina.out
0
 
LVL 6

Expert Comment

by:durgaprasad_j
ID: 13517507
hi,
 
  if you setup tomcat locally, try these.
     if you want to get those messages in your konsole, try "sh catalina.sh run" [ it will show the messages on to your kernel ].
now redirect these messages into the file that you want. "sh catalina.sh run > mylogfile.txt". [ you simly read those messages and send]

Dp
0
 
LVL 6

Accepted Solution

by:
durgaprasad_j earned 1000 total points
ID: 13517514
 if you want to get those messages in your konsole, try "sh catalina.sh run" [ it will show the messages on to your kernel ].

 (Should be )

  if you want to get those messages in your konsole, try "sh catalina.sh run" [ it will show the messages on to your konsole ].
0
 
LVL 35

Expert Comment

by:TimYates
ID: 13559249
No comment, and a grade C?

That seems a little unfair...

Some questions don't have a valid answer you know...
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month9 days, 19 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question