wood burning stoves
The moose likes Servlets and the fly likes how to analyse log file in tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to analyse log file in tomcat" Watch "how to analyse log file in tomcat" New topic

how to analyse log file in tomcat

rammie singh
Ranch Hand

Joined: Mar 26, 2009
Posts: 116
Hi everybody..
although i have done a handful of progrramming in java .... i am not comfortable in analysing the logs.
i amean what are the important points to conclude from the log...or how to determine that at which point my error is coming.
can anybody help me in analysing important conclusions from the log.
I am posting a sample log which is being produced in my application.

althoug i am able to conclude that there is a class cast exception.....i would like know wht else important point can be concluded from this log.

Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
This is the important information:

The top of the stacktrace tells you where the error arose.

In this case it was networkUser.jsp that threw a ClassCastException in like 340.

Note that this is not line 340 in your JSP but in the translated Java file that is under the work folder.
If you can't spot the error in your JSP go to the translated java file and look into line 340.

JDBCSupport - An easy to use, light-weight JDBC framework -
Ananth Chellathurai
Ranch Hand

Joined: Nov 21, 2007
Posts: 349

Hi Singh,

Every jsp will be compiled and converted to a servlet before execution. The log shows you have ClassCastException at line 340 of your networkUser.jsp. The line number 340 will the line number of the converted servlet and not the line number of the jsp.

You can go to your tomcat home > work\Catalina\localhost\your project name\org\apache\jsp

Open networkUser_jsp.java and go to line number 340 to find where the problem is.

Ananth Chellathurai [Walk on software]
rammie singh
Ranch Hand

Joined: Mar 26, 2009
Posts: 116
Hi every body ..thanks for your valuable information.
and sorry for not replying you all as i was a bit busy...
ok i have understood the meaning of firat two lines as you all have mentioned.
i alsso checked the converted servlet(jsp to servlet) file in tomcat work directory.
that was definately good .
Is there any other information we can extract from other lines....if posssible any one can prvide me some link ormaterial source to study this in detail.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
The most important ines that point to the offending code are the top line of the log. The other lines may provide information, but not sure how useful that might be to you.

So much trouble in the world -- Bob Marley
rammie singh
Ranch Hand

Joined: Mar 26, 2009
Posts: 116
Thanks every body.
I agree. Here's the link: http://aspose.com/file-tools
subject: how to analyse log file in tomcat
It's not a secret anymore!