AbstractAccessLogValve.AccessLogElement (Apache Tomcat 10.1.48 API Documentation)
Description: declaration: package: org.apache.catalina.valves, class: AbstractAccessLogValve, interface: AccessLogElement

# Interface AbstractAccessLogValve.AccessLogElement

All Known Implementing Classes:
  `AbstractAccessLogValve.ByteSentElement, AbstractAccessLogValve.ConnectionStatusElement, AbstractAccessLogValve.CookieElement, AbstractAccessLogValve.DateAndTimeElement, AbstractAccessLogValve.ElapsedTimeElement, AbstractAccessLogValve.FirstByteTimeElement, AbstractAccessLogValve.HeaderElement, AbstractAccessLogValve.HostElement, AbstractAccessLogValve.HttpStatusCodeElement, AbstractAccessLogValve.IdentifierElement, AbstractAccessLogValve.LocalAddrElement, AbstractAccessLogValve.LocalServerNameElement, AbstractAccessLogValve.LogicalUserNameElement, AbstractAccessLogValve.MethodElement, AbstractAccessLogValve.PortElement, AbstractAccessLogValve.ProtocolElement, AbstractAccessLogValve.QueryElement, AbstractAccessLogValve.RemoteAddrElement, AbstractAccessLogValve.RequestAttributeElement, AbstractAccessLogValve.RequestElement, AbstractAccessLogValve.RequestURIElement, AbstractAccessLogValve.ResponseHeaderElement, AbstractAccessLogValve.SessionAttributeElement, AbstractAccessLogValve.SessionIdElement, AbstractAccessLogValve.StringElement, AbstractAccessLogValve.ThreadNameElement, AbstractAccessLogValve.UserElement, ExtendedAccessLogValve.CookieElement, ExtendedAccessLogValve.DateElement, ExtendedAccessLogValve.RequestAttributeElement, ExtendedAccessLogValve.RequestHeaderElement, ExtendedAccessLogValve.RequestParameterElement, ExtendedAccessLogValve.ResponseAllHeaderElement, ExtendedAccessLogValve.ResponseHeaderElement, ExtendedAccessLogValve.ServletContextElement, ExtendedAccessLogValve.SessionAttributeElement, ExtendedAccessLogValve.TimeElement, JsonAccessLogValve.CharElement`

Enclosing class:
  `AbstractAccessLogValve`

protected static interface AbstractAccessLogValve.AccessLogElement
AccessLogElement writes the partial message into the buffer.

At least one method must be implemented else a loop will occur.

When the deprecated method is removed in Tomcat 12, the default implementation for `addElement(CharArrayWriter, Request, Response, long)` will also be removed.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default void`
  `addElement(CharArrayWriter buf, Date date, Request request, Response response, long time)`
  Deprecated.
  Unused.
  `default void`
  `addElement(CharArrayWriter buf, Request request, Response response, long time)`
  Called to create an access log entry.

- ## Method Details

  - ### addElement

    @Deprecated default void addElement(CharArrayWriter buf, Date date, Request request, Response response, long time)
    Deprecated.
    Unused. Will be removed in Tomcat 12. Use `addElement(CharArrayWriter, Request, Response, long)`
    Called to create an access log entry.
    Parameters:
      `buf` - The buffer to which the log element should be added
      `date` - The time stamp for the start of the request
      `request` - The request that triggered this access log entry
      `response` - The response to the request that triggered this access log entry
      `time` - The time taken in nanoseconds to process the request

  - ### addElement

    default void addElement(CharArrayWriter buf, Request request, Response response, long time)
    Called to create an access log entry.
    Parameters:
      `buf` - The buffer to which the log element should be added
      `request` - The request that triggered this access log entry
      `response` - The response to the request that triggered this access log entry
      `time` - The time taken in nanoseconds to process the request