Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference Between application log , Catalina Log and Localhost Log

 
Abhishek Rath
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

In my application deployed in Tomcat 6.x we have the application log getting logged in to the application log file and the start up logs are getting into Catalina Log.
However some of the logs are getting into Localhost Log which are not logged into the app log.We are using log4j.property for logging.

Could you please let me know the exact difference between application log , Catalina Log and Localhost Log in Tomcat with some examples(if possible).


Regards
Abhishek Rath
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The catalina log is the global log. It is, in fact, the stdout stream for the Tomcat JVM. Tomcat's internal log statements use the java.util.logging package (juli) to log, and the default destination for that log is stdout. The Tomcat run scripts handle the redirection of stdout to a file.

The localhost log is the log for a virtual host within Tomcat. Usually there's not much of interest in it, but when you cannot find an error in catalina.out and something is seriously wrong, check this file.

Each webapp is responsible for its own logging. Tomcat provides no support for application logs at all unless you want to count the old servlet log function that did a brain-dead write to Tomcat stdout. You can use any logger you want to in your webapp, including log4j, juli, apache commons logging, or - as in the case of some of my more complex apps, several of the preceeding, merged and co-ordinated by a master log manager (you have this issue when some of the pre-written third-party components in your webapp are using other loggers). Each webapp therefore is also responsible for its own log configuration.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic