StandardEngine.NoopAccessLog (Apache Tomcat 9.0.120 API Documentation)
Description: declaration: package: org.apache.catalina.core, class: StandardEngine, class: NoopAccessLog

# Class StandardEngine.NoopAccessLog

java.lang.Object
org.apache.catalina.core.StandardEngine.NoopAccessLog

All Implemented Interfaces:
  `AccessLog`

Enclosing class:
  `StandardEngine`

protected static final class StandardEngine.NoopAccessLog extends Object implements AccessLog
No-op implementation of AccessLog used as a placeholder when access logging is not configured.

- ## Field Summary

  ### Fields inherited from interface AccessLog

  `PROTOCOL_ATTRIBUTE, REMOTE_ADDR_ATTRIBUTE, REMOTE_HOST_ATTRIBUTE, SERVER_NAME_ATTRIBUTE, SERVER_PORT_ATTRIBUTE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NoopAccessLog()`
  Default constructor for no-op access log.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `getRequestAttributesEnabled()`
  Checks if request attributes will be logged.
  `void`
  `log(Request request, Response response, long time)`
  Add the request/response to the access log using the specified processing time.
  `void`
  `setRequestAttributesEnabled(boolean requestAttributesEnabled)`
  Should this valve use request attributes for IP address, hostname, protocol and port used for the request?

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### NoopAccessLog

    public NoopAccessLog()
    Default constructor for no-op access log.

- ## Method Details

  - ### log

    public void log(Request request, Response response, long time)
    Description copied from interface: `AccessLog`
    Add the request/response to the access log using the specified processing time.
    Specified by:
      `log` in interface `AccessLog`
    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

    public void setRequestAttributesEnabled(boolean requestAttributesEnabled)
    Description copied from interface: `AccessLog`
    Should this valve use request attributes for IP address, hostname, protocol and port used for the request? The attributes used are:
    - org.apache.catalina.AccessLog.RemoteAddr
    - org.apache.catalina.AccessLog.RemoteHost
    - org.apache.catalina.AccessLog.Protocol
    - org.apache.catalina.AccessLog.ServerName
    - org.apache.catalina.AccessLog.ServerPort
    Specified by:
      `setRequestAttributesEnabled` in interface `AccessLog`
    Parameters:
      `requestAttributesEnabled` - `true` causes the attributes to be used, `false` causes the original values to be used.

  - ### getRequestAttributesEnabled

    public boolean getRequestAttributesEnabled()
    Description copied from interface: `AccessLog`
    Checks if request attributes will be logged.
    Specified by:
      `getRequestAttributesEnabled` in interface `AccessLog`
    Returns:
      `true` if the attributes will be logged, otherwise `false`
    See Also:
      - `AccessLog.setRequestAttributesEnabled(boolean)`