This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Access Log Valve Parameter ' Requested URL path' Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Access Log Valve Parameter Watch "Access Log Valve Parameter New topic

Access Log Valve Parameter ' Requested URL path'

Robert Liberman

Joined: Nov 10, 2008
Posts: 1
First, I'm a developer not an administrator, so please be patient with me!

We have several hosts defined in our server.xml file. Here is an example of one. I have changed the host name for purposes of this example:

<Host name="" appBase="webapps/test">
<Context path="" docBase="."/>
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="test_access_log." suffix=".log"
pattern="combined" resolveHosts="true"/>

The problem is that I use WebTrends software to run metrics reports from our Apache Tomcat server. I want to be able to isolate data for but cannot because, for each user entry in the log file, the Requested URL path does not contain the absolute path - just the relative path from the application directory - i.e. "/".

Therefore, all log entries for all hosts contain the same path information.

Is there some logging parameter which will force each log entry to record the full, absolute path?

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

This page:
shows all the identifiers that can be used in the pattern attribute to customize the layout of the log files created by the valve.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
It is sorta covered in the JavaRanch Style Guide.
subject: Access Log Valve Parameter ' Requested URL path'