What's the difference between localhost.log, catalina.log, manager.log, host-manager.log ?
Asked Answered
A

2

23

I'm using Tomee. The logs folder contains files like this

  1. localhost_access_log.2016-12-02.txt
  2. localhost.2016-12-02.log
  3. catalina.2016-12-02.log
  4. host-manager.2016-12-02.log
  5. manager.2016-12-02.log

I was looking for an explanation in the documentation but could find anything. It's my understanding that those localhost files log only the 'host computer' activity. It this right? What is the difference between these file? Do they record different types of messages?

Admit answered 2/12, 2016 at 15:21 Comment(1)
related to #12869998, which was closed.Conoid
M
14

you can find all detail in conf/logging.properties and conf/server.xml for the access log.

In short

  • catalina is the container log file,
  • localhost_access (only one defined in server.xml) the access log (= all requests like in httpd),
  • localhost the log of the host and finally
  • host-manager and manager the logs of the related web applications.

Here a commented example to try to help you read logging.propertues:

# log on the host "localhost"
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].xxx

# log on the host "localhost" for the webapp foo
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/foo].xxx

More generally the pattern is:

org.apache.catalina.core.ContainerBase.[${engine}].[${host}].[${context}]

Side note: ${context} is "/" for the root context.

This syntax applies for ServletContext logging

All is explained https://tomcat.apache.org/tomcat-8.5-doc/logging.html

Maricamarice answered 5/12, 2016 at 9:42 Comment(6)
1) "catalina is the container log file" - What is meant by container here? 2) "localhost the log of the host - What is a host? 2a) What is a virtual host? 2b) How are they related?Colloquial
Container means tomcat (all but your app to summarize). It can be startup logs etc...host is the webapp container and linked to a network host (see server.xml). It will be used during deployments for instance.Maricamarice
But I see my web apps logs in catalina.out. Why is that?Colloquial
catalina.out is not a log file but the redirection of stdout in a file if your server is well configured it should always be empty cause it doesn't have rotation so if you keep logging inside that you will end up with a "disk full". it just means your logger logs on the console and not a file.Maricamarice
Considering that the question was asking about the differences between all these things, can you understand the limited helpfulness of providing an answer like "localhost the log of the host" ?Indeliberate
Well, question is then "do you know what a host is in tomcat?". You can check out a server.xml to see it is a contexts (webapps) container so then the related logs are just about that role and request handling at that level (kind of interceptor before context handling which then delegates to servlets). You can check out StandardHost and StandardHostValve for complete details.Maricamarice
F
0

I agree with user1445967. The best way to clarify would be to track the flow of execution and logging for a Tomcat startup through the first request, to understand what happens and where in the various modules of the total stack. Most abstractions are arbitrary and part of the software design to enhance flexibility through "injection" giving user the ability to configure various modules in xml files. It can be hard to understand exactly, for example, what an "engine" is/does unless you were the designer who factored out that piece of functionality and realized there was a need for user-configured alternatives of that functionality. So an example tracing through the startup and first request would be quite useful for not only understanding the architecture but also the logging that goes on. (will never happen I expect)

Fernando answered 19/9, 2020 at 18:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.