Local IP address or hostnames are shown no displayed in the Spectrum tomcat local_access_log

book

Article ID: 18729

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

By default we display in the $SPECROOT/tomcat/local_access_log the following information based upon the pattern variables.

%l - Remote logical username from identd (always returns '-')
%u - Remote user that was authenticated
%t - Date and time, in Common Log Format format
%r - First line of the request
%s - HTTP status code of the response
%b - Bytes sent, excluding HTTP headers, or '-' if no bytes were sent
%D - Time taken to process the request, in milliseconds

This looks like the following below:

  • spectrum [01/Mar/2014:00:00:05 -0500] POST /spectrum/common/poll?requestID=27116 HTTP/1.1 200 821 0

However no local IP address or hostnames are shown.

    Environment

    Release:
    Component:

    Resolution

    In order to add local IP address and hostname to the local_access_log please make the following changes.

    1. From the OneClick server, make a backup copy of $SPECROOT/tomcat/conf/server.xml
       
    2. With an XML editor of your choice find the following line:

      <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="%l %u %t %r %s %b %D" resolveHosts="false" />
       
    3. After the pattern= statement please add %A %v so the final version looks pattern="%A %v %l %u %t %r %s %b %D"
       
    4. Save and after restart of the tomcat you will now see local IP address and local server name appended to all output.

      130.x.x.x localhost - spectrum [14/Mar/2014:00:00:04 -0400] POST /spectrum/common/clearConfigs HTTP/1.1 200 58 0
       

    Additional Information

    Additional options can be added or changed from the tomcat AccessLogValve settings here