This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Difference Between application log , Catalina Log and Localhost Log Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Difference Between application log , Catalina Log and Localhost Log" Watch "Difference Between application log , Catalina Log and Localhost Log" New topic
Author

Difference Between application log , Catalina Log and Localhost Log

Abhishek Rath
Ranch Hand

Joined: Nov 22, 2007
Posts: 38
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

Joined: Jun 25, 2001
Posts: 15958
    
  19

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
wood burning stoves
 
subject: Difference Between application log , Catalina Log and Localhost Log
 
Similar Threads
Unable to locate error logs
Container questions
Tomcat startup problem after deployment of an application
Unable to make tomcat log 404 type error messages.
welcome file list