I'm using Tomee. The logs folder contains files like this
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?
Localhost Log : This is the log for all HTTP transactions between the client and the application server. The log file is named as, localhost_access_log. <date of log generation>. txt file. The default location and rotation policy for this log is the same as catalina.
The Apache Tomcat logs are an essential feature that allows sysadmins to view what is accessed and how the server handles the various resources. Although you can implement logging for the Java applications written for Tomcat, getting the internal webserver logs can be instrumental in troubleshooting.
Tomcat is actually composed of a number of components, including a Tomcat JSP engine and a variety of different connectors, but its core component is called Catalina. Catalina provides Tomcat's actual implementation of the servlet specification; when you start up your Tomcat server, you're actually starting Catalina.
you can find all detail in conf/logging.properties and conf/server.xml for the access log.
In short
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With