This documentation supports the 9.1 version of Remedy Action Request System.

To view the latest version, select the version from the Product version menu.

Apache Tomcat valve logging

Apache Tomcat Valve logging helps to determine the following;

  • Whether an HTTP request is received by the Apache Tomcat server that hosts the mid tier application. 
  • Header information. 

You can enable the Apache Tomcat valve logging from the server.xml file located in the Tomcat\conf\ folder.

To enable Apache Tomcat valve logging

  1. Search for the following entry in the server.xml file located in the <tomcat_install>/conf/ folder.
    <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false">
  2. Check if the following Valve statement is available. Add the Valve statement if it is not available.

    <Valve className="org.apache.catalina.valves.
    FastCommonAccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".log" pattern="%h %t  %u &quot;%r&quot; %s b:%b t:%D p:%F" resolveHosts="false" />
    Apache Tomcat version 7 or earlier<Valve className="org.apache.catalina.valves.
    FastCommonAccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".log" pattern="%h %t %u %{JSESSIONID}c &quot;%r&quot; %s b:%b t:%D p:%F" resolveHosts="false" />

    Apache Tomcat version 8 or later<Valve className="org.apache.catalina.valves.
    AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %t %u %{JSESSIONID}c &quot;%r&quot; %s b:%b t:%D p:%F " />

    This pattern captures the following details:

    • Client IP

    • Date and time of request
    • User name
    • JSESSIONID cookie sent with the request
    • Request
    • Status
    • Bytes sent
    • Total process time including transfer to browser in milliseconds
    • Process time excluding transfer in milliseconds
  3. Restart the Apache Tomcat server.

Each HTTP request is now logged in the localhost_access*.log file located in the <tomcat_install>\logs\ folder.

Pattern details

The following table describes the pattern details:

Pattern

Description

%aRemote IP address
%ALocal IP address
%bBytes sent, excluding HTTP headers, or '-' if zero
%B

Bytes sent, excluding HTTP headers

%h

Remote host name (or IP address if resolve Hosts is false)

%H

Request protocol

%l

Remote logical username from identd (always returns '-')

%m

Request method (GET, POST)

%pLocal port on which this request was received
%q

Query string (appended with a '?' if it exists)

%rFirst line of the request (method and request URI)
%s

HTTP status code of the response

%S

User session ID

%tDate and time, in Common Log Format
%uRemote user that was authenticated (if any), else '-'
%U

Requested URL path

%v

Local server name

%DTime taken to process the request and transfer results to browser, in milliseconds
%F

Time taken to process the request, in milliseconds

%TTime taken to process the request, in seconds
%ICurrent request thread name (can compare later with stack traces)

%{xxx}i

write value of incoming header with name xxx  ex:  %{Cookie}i  will get you all the cookies sent
%{xxx}owrite value of outgoing header with name xxx

 %{xxx}c

write value of cookie with name xxx   ex: %{JSESSIONID}c

Examples

The following example illustrates the Valve statement to check Accept-Encoding headers.

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".log" pattern="%t %m %r %s Encoding:%{Accept-Encoding}i" resolveHosts="false"/>

The following example illustrates the Valve statement to track the JSESSIONID cookie submitted with each request

<Valve className="org.apache.catalina.valves.AccessLogValve"
 directory="logs" prefix="localhost_access_log" suffix=".txt" 
pattern="%h %t %u %{JSESSIONID}c &quot;%r&quot; %s " />

Related topic

Enabling logs for Remedy Mid Tier troubleshooting

Was this page helpful? Yes No Submitting... Thank you

Comments