How to Review Tomcat Access Logs After an Exploit Alert
Where Tomcat access logs live, how to read the common log format, how to search for requests to a vulnerable path and how to tell a probe from real traffic.
Tomcat access logs record every HTTP request a Java web application received, including the method, path, status code and client address. When a vendor announces that a flaw in your application is being exploited, those logs are the fastest way to answer the first question: did anyone hit the vulnerable path? This guide explains where Tomcat writes the access log, how to read its default format, how to search it for a specific endpoint, and how to tell a probe from normal traffic.
Where are Tomcat access logs?
Tomcat writes access logs through a component called the access log valve, which is configured in the main server configuration file and normally nested inside the Host element. By default the files land in the logs directory of the Tomcat instance, with one file per day. The stock configuration names them with the prefix localhost_access_log, a date stamp and a .txt suffix.
In configuration terms, the valve is org.apache.catalina.valves.AccessLogValve, declared in conf/server.xml, and the directory is logs relative to CATALINA_BASE. The Tomcat documentation describes the standard configuration this way:
<Valve className="org.apache.catalina.valves.AccessLogValve"
prefix="localhost_access_log" suffix=".txt"
pattern="common"/>
Three attributes matter for an investigation. The directory attribute defaults to logs relative to CATALINA_BASE. The rotatable attribute defaults to true, so each day gets its own file. The maxDays attribute defaults to -1, meaning Tomcat never deletes old access logs on its own, so you may have more history than you expect unless a logrotate job or disk cleanup has removed it.
Do not confuse the access log with catalina.out or the dated catalina. and localhost. files. Those come from Tomcat's own logging framework, configured in conf/logging.properties, and hold application and container messages rather than one line per request. They are useful later, when you look for exceptions thrown while a request was being parsed, but the access log is where you start.
How do you read the default access log format?
The default common pattern writes seven fields per line: the remote host, the identd user (always a dash), the authenticated user, the timestamp, the request line in quotes, the HTTP status code and the response size in bytes. The combined pattern adds the Referer and User-Agent headers in quotes.
The Tomcat docs define common as %h %l %u %t "%r" %s %b. The request line, %r, is the field you will search most, because it contains both the method and the path, for example POST /roller-services/xmlrpc HTTP/1.1. The status code tells you how the application answered. The byte count tells you how much it sent back.
If your access log sits behind a reverse proxy, %h will show the proxy's address for every request unless Tomcat is told to trust the forwarded header. The requestAttributesEnabled attribute on the valve, combined with the RemoteIpValve, makes the access log record the original client address from X-Forwarded-For instead. If that was not configured before the incident, correlate the Tomcat log with the proxy's own access log by timestamp to recover client addresses.
Searching for a vulnerable endpoint
Take the path from the vendor advisory and search every retained access log file for requests to it. For the November 2026 Apache Roller flaw covered in our report on CVE-2026-129448, the path is /roller-services/xmlrpc, or /roller/roller-services/xmlrpc when the application runs under a context path.
grep -h 'POST /roller-services/xmlrpc' localhost_access_log.* | cut -d' ' -f1 | sort | uniq -c | sort -rn
This produces a count of requests per client address. Compare the list against the addresses that legitimately use the endpoint. For an XML-RPC blog API, that is the small set of desktop publishing clients your authors run. Any other address posting to the path is a candidate for investigation. Rotated logs that have been compressed need zgrep instead of grep.
Pay attention to three things in the matching lines:
- Method. Legitimate use of an API endpoint and an exploit attempt usually share the same method, so the method alone rarely separates them. But a GET to a POST-only endpoint is a scanner fingerprinting the server.
- Status codes. A 200 means the application processed the request body. A 404 or 403 means something in front of the handler rejected it. On Roller 6.1.6 and later with XML-RPC disabled, the new filter returns 404 before the body is read, so a run of 200s followed by 404s after a certain date can show you exactly when the patch took effect.
- Timing clusters. Dozens of requests to one path from one address within seconds is automated. A real blogging client posts a handful of calls when an author publishes.
The default pattern does not log request bodies, so the access log alone cannot show you whether a request contained the malicious structure the advisory describes. If a WAF or proxy in front of Tomcat logs bodies, search there for the strings the vendor or researchers published. For the Roller case, those were ex:serializable and the base64 prefix rO0AB, which marks a serialized Java object. For protocol background on why these endpoints parse before they authenticate, see what XML-RPC is and why it still matters.
Why do exploit attempts often return 200?
A deserialization or injection flaw is triggered while the server parses the request, before the application decides whether the caller is allowed in. The server may still return a normal status code or an XML fault afterward, because from the application's point of view the request simply failed authentication. A successful exploit therefore looks like an ordinary failed login in the access log, which is why you must correlate with application logs and host evidence rather than relying on status codes alone.
Response bodies can carry a tell that status codes do not. In the Roller case, researchers noted that a response containing Failed to load class for result object meant a vulnerable server had attempted to deserialize attacker-supplied input. Proxies that log response bodies, or packet captures, are the only place to see that.
Correlating with the rest of the host
Once you have a list of suspicious request timestamps, move to the container and host logs for the same windows:
- Read the dated
catalina.andlocalhost.files in thelogsdirectory for stack traces, class-not-found errors or parser exceptions at those times. An exception inside a deserialization or XML parsing class right after a suspicious POST is strong corroboration. - Check the
webappsdirectories for JSP or class files with modification times near the requests. Web shells are usually dropped there. - Review process accounting or EDR telemetry for child processes of the Tomcat JVM. A Java application server should not spawn a shell,
curlor a scripting interpreter. - Compare the application's user table against your records. New administrator accounts created shortly after a suspicious request are a common post-exploitation step.
Fixing the logging gap before the next advisory
The investigation above is harder than it needs to be on a default install. Three changes make the next one faster:
- Switch the valve from
commontocombined, or add%Dfor request duration and%{X-Forwarded-For}ifor the forwarded client address, so a single log line carries enough to spot automation and recover true sources. - Set
maxDaysto a deliberate retention period and ship the files to central log storage, so a compromise is not followed by the attacker deleting the only copy. - Enable
requestAttributesEnabledwithRemoteIpValvewhenever Tomcat sits behind a proxy, so%hmeans the client and not the load balancer.
None of these change how the application behaves. They only change how much you know when the next vendor email arrives.