Package io.helidon.webserver.accesslog
Class AccessLogConfig.BuilderBase<BUILDER extends AccessLogConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends AccessLogConfig>
java.lang.Object
io.helidon.webserver.accesslog.AccessLogConfig.BuilderBase<BUILDER,PROTOTYPE>
- Type Parameters:
BUILDER
- type of the builder extending this abstract builderPROTOTYPE
- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER,
,PROTOTYPE> Prototype.ConfiguredBuilder<BUILDER,
PROTOTYPE>
- Direct Known Subclasses:
AccessLogConfig.Builder
- Enclosing interface:
AccessLogConfig
public abstract static class AccessLogConfig.BuilderBase<BUILDER extends AccessLogConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends AccessLogConfig>
extends Object
implements Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
AccessLogFeature
.-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Generated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddEntries
(List<? extends AccessLogEntry> entries) Configured log entries.addEntry
(AccessLogEntry entry) Configured log entries.addSockets
(Set<? extends String> sockets) List of sockets to register this feature on.Clear existing value of this property.clock()
Configure an alternative clock to use, such asClock.fixed(java.time.Instant, java.time.ZoneId)
.Configure an alternative clock to use, such asClock.fixed(java.time.Instant, java.time.ZoneId)
.Usecommon
log format.config()
If this instance was configured, this would be the config instance used.Update builder from configuration (node of this type).Use default log format.boolean
enabled()
Whether this feature will be enabled.enabled
(boolean enabled) Whether this feature will be enabled.entries()
Configured log entries.entries
(List<? extends AccessLogEntry> entries) Configured log entries.format()
The format for log entries (similar to the ApacheLogFormat
).The format for log entries (similar to the ApacheLogFormat
).from
(AccessLogConfig prototype) Update this builder from an existing prototype instance.from
(AccessLogConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.Name of the logger used to obtain access log logger fromSystem.getLogger(String)
.loggerName
(String loggerName) Name of the logger used to obtain access log logger fromSystem.getLogger(String)
.name()
Name of this instance.Name of this instance.protected void
Handles providers and decorators.sockets()
List of sockets to register this feature on.List of sockets to register this feature on.toString()
protected void
Validates required properties.double
weight()
Weight of the access log feature.weight
(double weight) Weight of the access log feature.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
Methods inherited from interface io.helidon.builder.api.Prototype.ConfiguredBuilder
discoverService, discoverServices
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance. This method disables automatic service discovery.- Parameters:
prototype
- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder
- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
defaultLogFormat
Use default log format.Clears the current log entries and replaces them with default log format.
Helidon log format uses the following log entries (in this order):
- Returns:
- updated builder instance
-
commonLogFormat
Usecommon
log format.Clears the current log entries and replaces them with
common
log format.common
log format uses the following log entries (in this order):- Returns:
- updated builder instance
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
config
in interfacePrototype.ConfiguredBuilder<BUILDER extends AccessLogConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends AccessLogConfig> - Parameters:
config
- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
entries
- Parameters:
entries
- list of access log entries- Returns:
- updated builder instance
- See Also:
-
addEntries
- Parameters:
entries
- list of access log entries- Returns:
- updated builder instance
- See Also:
-
addEntry
- Parameters:
entry
- list of access log entries- Returns:
- updated builder instance
- See Also:
-
clock
Configure an alternative clock to use, such asClock.fixed(java.time.Instant, java.time.ZoneId)
. Defaults toClock.systemDefaultZone()
.- Parameters:
clock
- clock to use to get current times- Returns:
- updated builder instance
- See Also:
-
loggerName
Name of the logger used to obtain access log logger fromSystem.getLogger(String)
. Defaults to "io.helidon.webserver.AccessLog".- Parameters:
loggerName
- name of the logger to use- Returns:
- updated builder instance
- See Also:
-
weight
Weight of the access log feature. We need to log access for anything happening on the server, so weight is high: 1000.0.- Parameters:
weight
- weight of the feature- Returns:
- updated builder instance
- See Also:
-
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.- Parameters:
sockets
- socket names to register on, defaults to empty (all available sockets)- Returns:
- updated builder instance
- See Also:
-
addSockets
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.- Parameters:
sockets
- socket names to register on, defaults to empty (all available sockets)- Returns:
- updated builder instance
- See Also:
-
name
Name of this instance.- Parameters:
name
- instance name- Returns:
- updated builder instance
- See Also:
-
clearFormat
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
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
- Parameters:
format
- format string, such as%h %l %u %t %r %b %{Referer}i
- Returns:
- updated builder instance
- See Also:
-
enabled
Whether this feature will be enabled.- Parameters:
enabled
- whether enabled- Returns:
- updated builder instance
- See Also:
-
entries
- Returns:
- the entries
-
clock
Configure an alternative clock to use, such asClock.fixed(java.time.Instant, java.time.ZoneId)
. Defaults toClock.systemDefaultZone()
.- Returns:
- the clock
-
loggerName
Name of the logger used to obtain access log logger fromSystem.getLogger(String)
. Defaults to "io.helidon.webserver.AccessLog".- Returns:
- the logger name
-
weight
public 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:
- the weight
-
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:
- the sockets
-
name
Name of this instance.- Returns:
- the 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:
- the format
-
enabled
public boolean enabled()Whether this feature will be enabled.- Returns:
- the enabled
-
config
If this instance was configured, this would be the config instance used.- Returns:
- config node used to configure this builder, or empty if not configured
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties.
-