Package io.helidon.webserver.accesslog
Interface AccessLogConfig
- All Superinterfaces:
Prototype.Api
,Prototype.Factory<AccessLogFeature>
- All Known Implementing Classes:
AccessLogConfig.BuilderBase.AccessLogConfigImpl
Configuration of access log feature.
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Fluent API builder forAccessLogFeature
.static class
AccessLogConfig.BuilderBase<BUILDER extends AccessLogConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends AccessLogConfig> Fluent API builder base forAccessLogFeature
. -
Field Summary
Modifier and TypeFieldDescriptionstatic final List
<AccessLogEntry> Common log format, seeAccessLogConfig.BuilderBase.commonLogFormat()
.static final List
<AccessLogEntry> Helidon log format, seeAccessLogConfig.BuilderBase.defaultLogFormat()
. -
Method Summary
Modifier and TypeMethodDescriptionstatic AccessLogConfig.Builder
builder()
Create a new fluent API builder to customize configuration.static AccessLogConfig.Builder
builder
(AccessLogConfig instance) Create a new fluent API builder from an existing instance.clock()
Configure an alternative clock to use, such asClock.fixed(java.time.Instant, java.time.ZoneId)
.static AccessLogConfig
create()
Create a new instance with default values.static AccessLogConfig
Create a new instance from configuration.boolean
enabled()
Whether this feature will be enabled.entries()
Configured log entries.format()
The format for log entries (similar to the ApacheLogFormat
).Name of the logger used to obtain access log logger fromSystem.getLogger(String)
.name()
Name of this instance.sockets()
List of sockets to register this feature on.double
weight()
Weight of the access log feature.Methods inherited from interface io.helidon.builder.api.Prototype.Factory
build
-
Field Details
-
COMMON_FORMAT
Common log format, seeAccessLogConfig.BuilderBase.commonLogFormat()
. -
HELIDON_FORMAT
Helidon log format, seeAccessLogConfig.BuilderBase.defaultLogFormat()
.
-
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
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
Create a new instance from configuration.- Parameters:
config
- used to configure the new instance- Returns:
- a new instance configured from configuration
-
create
Create a new instance with default values.- Returns:
- a new instance
-
entries
List<AccessLogEntry> entries()- Returns:
- list of access log entries
-
clock
Clock clock()Configure an alternative clock to use, such asClock.fixed(java.time.Instant, java.time.ZoneId)
. Defaults toClock.systemDefaultZone()
.- Returns:
- clock to use to get current times
-
loggerName
String loggerName()Name of the logger used to obtain access log logger fromSystem.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
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
The format for log entries (similar to the ApacheLogFormat
).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
-