Skip to content

Improving tomcat access logs for THREDDS and ERDDAP

Dan Nowacki edited this page Sep 26, 2019 · 1 revision

The default tomcat access logging is pretty limited and does not include user agents. You can change this by updating the lines in server.xml to be:

        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="combined" />

The important part is pattern="combined". This enables user agent logging. The remote IP address logging doesn't seem to work, even after adding

        <Valve className="org.apache.catalina.valves.RemoteIpValve" />

above the access log valve. More info on access logging here.