Interface AccessLog

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PROTOCOL_ATTRIBUTE
      Name of request attribute used to override the protocol recorded by the AccessLog.
      static java.lang.String REMOTE_ADDR_ATTRIBUTE
      Name of request attribute used to override the remote address recorded by the AccessLog.
      static java.lang.String REMOTE_HOST_ATTRIBUTE
      Name of request attribute used to override remote host name recorded by the AccessLog.
      static java.lang.String SERVER_NAME_ATTRIBUTE
      Name of request attribute used to override the server name recorded by the AccessLog.
      static java.lang.String SERVER_PORT_ATTRIBUTE
      Name of request attribute used to override the server port recorded by the AccessLog.
    • Field Detail

      • REMOTE_ADDR_ATTRIBUTE

        static final java.lang.String REMOTE_ADDR_ATTRIBUTE
        Name of request attribute used to override the remote address recorded by the AccessLog.
        See Also:
        Constant Field Values
      • REMOTE_HOST_ATTRIBUTE

        static final java.lang.String REMOTE_HOST_ATTRIBUTE
        Name of request attribute used to override remote host name recorded by the AccessLog.
        See Also:
        Constant Field Values
      • PROTOCOL_ATTRIBUTE

        static final java.lang.String PROTOCOL_ATTRIBUTE
        Name of request attribute used to override the protocol recorded by the AccessLog.
        See Also:
        Constant Field Values
      • SERVER_NAME_ATTRIBUTE

        static final java.lang.String SERVER_NAME_ATTRIBUTE
        Name of request attribute used to override the server name recorded by the AccessLog.
        See Also:
        Constant Field Values
      • SERVER_PORT_ATTRIBUTE

        static final java.lang.String SERVER_PORT_ATTRIBUTE
        Name of request attribute used to override the server port recorded by the AccessLog.
        See Also:
        Constant Field Values
    • Method Detail

      • log

        void log​(Request request,
                 Response response,
                 long time)
        Add the request/response to the access log using the specified processing time.
        Parameters:
        request - Request (associated with the response) to log
        response - Response (associated with the request) to log
        time - Time taken to process the request/response in milliseconds (use 0 if not known)
      • setRequestAttributesEnabled

        void setRequestAttributesEnabled​(boolean requestAttributesEnabled)
        Should this valve set request attributes for IP address, hostname, protocol and port used for the request? This are typically used in conjunction with the AccessLogValve which will otherwise log the original values. The attributes set are:
        • org.apache.catalina.RemoteAddr
        • org.apache.catalina.RemoteHost
        • org.apache.catalina.Protocol
        • org.apache.catalina.ServerPost
        Parameters:
        requestAttributesEnabled - true causes the attributes to be set, false disables the setting of the attributes.