Class AbstractLogEntry

java.lang.Object
io.helidon.webserver.accesslog.AbstractLogEntry
All Implemented Interfaces:
AccessLogEntry, Handler, BiConsumer<ServerRequest,ServerResponse>
Direct Known Subclasses:
HeaderLogEntry, HostLogEntry, RequestLineLogEntry, SizeLogEntry, StatusLogEntry, TimestampLogEntry, TimeTakenLogEntry, UserLogEntry

public abstract class AbstractLogEntry extends Object implements AccessLogEntry
Common log entry features.
  • Field Details

    • DEFAULT_MAX_LENGTH

      public static final int DEFAULT_MAX_LENGTH
      Default limit for the number of characters written.
      See Also:
  • Constructor Details

  • Method Details

    • apply

      public String apply(AccessLogContext context)
      Apply the log entry, adds padding to the log entry and then calls doApply(AccessLogContext).
      Specified by:
      apply in interface AccessLogEntry
      Parameters:
      context - context with access to information useful for access log entries
      Returns:
      formatted log entry
    • maxLength

      protected String maxLength(String toLimit)
      Apply maximal length limitation.
      Parameters:
      toLimit - sanitized string
      Returns:
      shortened string
    • sanitize

      protected String sanitize(String toSanitize)
      Apply configured sanitization.
      Parameters:
      toSanitize - string to sanitize
      Returns:
      sanitized string
    • pad

      protected String pad(String toPad)
      Apply configured padding.
      Parameters:
      toPad - string to pad
      Returns:
      padded string
    • doApply

      protected abstract String doApply(AccessLogContext context)
      Apply the "raw" log entry. The result will go through common formatting, such as padding if configured.
      Parameters:
      context - context with access to information useful for access log entries
      Returns:
      log entry
      See Also: