Interface AccessLogConfig

All Superinterfaces:
Prototype.Api, Prototype.Factory<AccessLogFeature>
All Known Implementing Classes:
AccessLogConfig.BuilderBase.AccessLogConfigImpl

public interface AccessLogConfig extends Prototype.Api
Configuration of access log feature.
See Also:
  • Field Details

  • Method Details

    • builder

      static AccessLogConfig.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      static AccessLogConfig.Builder builder(AccessLogConfig instance)
      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static AccessLogConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static AccessLogConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • entries

      List<AccessLogEntry> entries()
      Configured log entries. If both entries and format() are defined, format() is used.
      Returns:
      list of access log entries
    • clock

      Clock clock()
      Configure an alternative clock to use, such as Clock.fixed(java.time.Instant, java.time.ZoneId). Defaults to Clock.systemDefaultZone().
      Returns:
      clock to use to get current times
    • loggerName

      String loggerName()
      Name of the logger used to obtain access log logger from System.getLogger(String). Defaults to "io.helidon.webserver.AccessLog".
      Returns:
      name of the logger to use
    • weight

      double weight()
      Weight of the access log feature. We need to log access for anything happening on the server, so weight is high: 1000.0.
      Returns:
      weight of the feature
    • sockets

      Set<String> sockets()
      List of sockets to register this feature on. If empty, it would get registered on all sockets. The logger used will have the expected logger with a suffix of the socket name.
      Returns:
      socket names to register on, defaults to empty (all available sockets)
    • name

      String name()
      Name of this instance.
      Returns:
      instance name
    • format

      Optional<String> format()
      The format for log entries (similar to the Apache LogFormat).
      Log format elements
      %h IP address of the remote host HostLogEntry
      %l The client identity. This is always undefined in Helidon. UserIdLogEntry
      %u User ID as asserted by Helidon Security. UserLogEntry
      %t The timestamp TimestampLogEntry
      %r The request line ("GET /favicon.ico HTTP/1.0") RequestLineLogEntry
      %s The status code returned to the client StatusLogEntry
      %b The entity size in bytes SizeLogEntry
      %D The time taken in microseconds (start of request until last byte written) TimeTakenLogEntry
      %T The time taken in seconds (start of request until last byte written), integer TimeTakenLogEntry
      %{header-name}i Value of header header-name HeaderLogEntry
      Returns:
      format string, such as %h %l %u %t %r %b %{Referer}i
    • enabled

      boolean enabled()
      Whether this feature will be enabled.
      Returns:
      whether enabled