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> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,,PROTOTYPE> ConfigBuilderSupport.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 ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
AccessLogConfig.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddEntries(List<? extends AccessLogEntry> entries) Configured log entries.addEntry(AccessLogEntry entry) Configured log entries.addSockets(Set<String> sockets) List of sockets to register this feature on.Clear all entries.Clear existing value of format.Clear all sockets.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).Usecommonlog format.config()Configuration used to configure this instance.Deprecated.Update builder from configuration (node of this type).Use default log format.booleanenabled()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 voidHandles providers and decorators.sockets()List of sockets to register this feature on.List of sockets to register this feature on.toString()protected voidValidates required properties.doubleweight()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, waitMethods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
-
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
Usecommonlog format.Clears the current log entries and replaces them with
commonlog format.commonlog format uses the following log entries (in this order):- Returns:
- updated builder instance
-
config
Deprecated.Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.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
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.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
-
clearEntries
Clear all entries.- Returns:
- updated builder instance
- See Also:
-
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- add single 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:
-
clearSockets
Clear all sockets.- 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 format.- 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-nameHeaderLogEntry- 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:
- list of access log entries
-
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
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
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:
- 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
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-nameHeaderLogEntry- Returns:
- format string, such as
%h %l %u %t %r %b %{Referer}i
-
enabled
public boolean enabled()Whether this feature will be enabled.- Returns:
- whether enabled
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties. -
config
Configuration used to configure this instance.- Returns:
- config instance
-
config(io.helidon.config.Config)