Tomcat server can be configured to use different type of logging systems, the server comes with has default logging configuration and can be configured to use log4j. The Tomcat can also create access logs are based on the LogValve interface and
Steps:
Access Log Valve.
Tagging
All Tomcat/Catalina logs are tagged by logtype - tomcat
In addition there are the following log types that must be assigned for the Tomcat App to be deployed on:
- Catalina out log or Console out log will be tagged by logtype - out
- Catalina Servlet or webapp log will be tagged by logtype - servlet
- Access logs will be tagged by logtype - access
Default Log structure and configuration
Custom Logging
If the Tomcat server is configured to use external logging with log4j or other java.util framework than use XpoLog pattern wizard and defenition to configure the log pattern correctly for the app to work.
Make sure that if you are using log4j wizard you will need to setup the log sources and manually apply the Tomcat/Catalina tags on them for the App to work correctly.
Steps:
- Add Log Data In XpoLog, When adding a log to XpoLog you can now select the Log Type (logtype) for Apache Tomcat with the following logtypes:
- tomcat
- in addition select also the log type - access or out or servlet
- in addition select also the log type - access or out or servlet
- tomcat
- Once all required information is set click next and edit the log pattern, this step is crucial to the accuracy and deployment of the Analytic App. Use the following conversion table to build the XpoLog pattern out of the log format.
...
{geoip:Client IP,ftype=remoteip;type=;,} {string:Remote Log Name,ftype=remotelog;,} {string:Remote User,ftype=remoteuser;,} [{date:Date,locale=en,dd/MMM/yyyy:HH:mm:ss z}] "{choice:Method,ftype=reqmethod;,GET;POST} {string:URL,ftype=requrl;,}{block,start,emptiness=true}?{string:Query,ftype=querystring;,}{block,end,emptiness=true} {string:reqprotocol,ftype=reqprotocol;,}" {number:Status,ftype=respstatus;,} {number:Bytes Sent,ftype=bytesent;,}{block,start,emptiness=true} {number:TimeToPrcessRequest,ftype=processrequestmilli;,}{block,end,emptiness=true} "{string:Referer,ftype=referer;,}" "{string:User Agent,ftype=useragent;,}"{eoe}For more information see below:
References
https://tomcat.apache.org/tomcat-7.0-doc/logging.html
...