Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat 5.5 logging internal process in tomcat_out.log

 
Sivaraman Lakshmanan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
We recently migrated to Tomcat 5.5.26 We are using java 1.5. After migration I could see our tomcat_out.log file is filled with to many internal tomcat debug lines. Tomcat is filling too many things in the log file. None of our application specific logs are logged. All the application that we use are using log4j and even those files are not created. Could someone please help in stopping tomcat logging internal stuff in to tomcat_out.log. Tomcat is running in solaris box.

Below are the sample lines from the log file.


Any help on this is very much appreciated.
 
Sivaraman Lakshmanan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is there someone who can help on this issue. Any help will be very much appreciated.
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sivaraman Lakshmanan wrote:We recently migrated to Tomcat 5.5.26


From?

I would check logging.properties file, more details could be found at http://tomcat.apache.org/tomcat-5.5-doc/logging.html
 
Sivaraman Lakshmanan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Misha,
Thanks for replying. We migrated form Tomcat 4.1.2 to Tomcat 5.5. I actually checked the link you gave but unfortunately our setup don't have this logging.properties files in the /common/classes directory. I use log4j for all of my applications. I am wondering why by default tomcat 5.5 is running in debug log mode enabled but not tomcat 4.1.2? Is there any way I can force to change this to Info logging mode.
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think you have a default tomcat 5.5 configuration. In case of default configuration Tomcat would write log to catalina.out file not tomcat_out.log file.
 
Sivaraman Lakshmanan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have added the log4j.properties file in the classpath. In the properties file I have made to INFO. Still I am seeing all the debug log happening. Is there a way to stop this. I have given below the content of the log4j properties file which I kept in classpath.

 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Offhand, it looks like one of 2 possible problems.

1. The logging isn't being done by a Log4J logger, so the Log4J settings don't apply.

2. You haven't set loggers for the application. The class that's producing all the noise isn't in package org.apache.catalina.session, it's in "session". Meaning it's one of the application classes and the package naming for the application isn't in the recommended form with the developer's domain name as part of the package name. You'd need something more like

I rather doubt the org.apache.catalina loggers actually get used. Tomcat maintains its own loggers independent of the loggers for the webapps. It's confusingly documented, however, and the details have changed in the near past.
 
Sivaraman Lakshmanan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,
Thanks for the reply. As you said if Log4j is not applicable could you please advice what log settings I should do to stop these logging. I have gone through the tomcat documentation but no luck. As you said the documentation is quite confusing.

Based on your point 2 is there a way to find the package name which is not in recomended format.

Help on this is very much appreciated.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think probably log4j is doing the logging. Actually, the package name isn't really what counts, its the logging context name. But the convention is to use the name of the class being logged as its logger name in most cases.

The name of the offending logger, based on your sample messages is "session.ManagerBase". So if you wanted to alter the logging level for just that one class, you'd enter this:


If you wanted to alter logging levels for all classes in the package named "session", you'd use the example I showed earlier and the ManagerBase logger would inherit the "session" package logger.

Logging is a good example of why the best practice for application design includes the developer's domain name as part of the package structure. If I have a class named "SessionFactory" and Hibernate has a class named "SessionFactory", if we'd both used the package named "session", not only would we probably have classloading problems due to overlapping classnames, we wouldn't be able to fine-tune the logging. So they have org.hibernate.session.SessionFactory and I have com.mousetech.mywebapp.web.SessionFactory and stuff like that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic