Package io.helidon.webserver.accesslog
Class AccessLogConfig.BuilderBase.AccessLogConfigImpl
java.lang.Object
io.helidon.webserver.accesslog.AccessLogConfig.BuilderBase.AccessLogConfigImpl
- All Implemented Interfaces:
Prototype.Api
,Prototype.Factory<AccessLogFeature>
,AccessLogConfig
,Supplier<AccessLogFeature>
- Enclosing class:
AccessLogConfig.BuilderBase<BUILDER extends AccessLogConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends AccessLogConfig>
protected static class AccessLogConfig.BuilderBase.AccessLogConfigImpl
extends Object
implements AccessLogConfig, Supplier<AccessLogFeature>
Generated implementation of the prototype, can be extended by descendant prototype implementations.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.helidon.webserver.accesslog.AccessLogConfig
AccessLogConfig.Builder, AccessLogConfig.BuilderBase<BUILDER extends AccessLogConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends AccessLogConfig> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final List
<AccessLogEntry> Common log format, seeAccessLogConfig.BuilderBase.commonLogFormat()
.static final List
<AccessLogEntry> Helidon log format, seeAccessLogConfig.BuilderBase.defaultLogFormat()
. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AccessLogConfigImpl
(AccessLogConfig.BuilderBase<?, ?> builder) Create an instance providing a builder. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Create a new instance of the runtime type from this config object.clock()
Configure an alternative clock to use, such asClock.fixed(java.time.Instant, java.time.ZoneId)
.boolean
enabled()
Whether this feature will be enabled.entries()
Configured log entries.boolean
format()
The format for log entries (similar to the ApacheLogFormat
).get()
int
hashCode()
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.toString()
double
weight()
Weight of the access log feature.
-
Field Details
-
COMMON_FORMAT
Common log format, seeAccessLogConfig.BuilderBase.commonLogFormat()
. -
HELIDON_FORMAT
Helidon log format, seeAccessLogConfig.BuilderBase.defaultLogFormat()
.
-
-
Constructor Details
-
AccessLogConfigImpl
Create an instance providing a builder.- Parameters:
builder
- extending builder base of this prototype
-
-
Method Details
-
build
Description copied from interface:Prototype.Factory
Create a new instance of the runtime type from this config object.- Specified by:
build
in interfacePrototype.Factory<AccessLogFeature>
- Returns:
- new configured runtime instance
-
get
- Specified by:
get
in interfaceSupplier<AccessLogFeature>
-
entries
Description copied from interface:AccessLogConfig
Configured log entries. If both entries andAccessLogConfig.format()
are defined,AccessLogConfig.format()
is used.- Specified by:
entries
in interfaceAccessLogConfig
- Returns:
- list of access log entries
-
clock
Description copied from interface:AccessLogConfig
Configure an alternative clock to use, such asClock.fixed(java.time.Instant, java.time.ZoneId)
. Defaults toClock.systemDefaultZone()
.- Specified by:
clock
in interfaceAccessLogConfig
- Returns:
- clock to use to get current times
-
loggerName
Description copied from interface:AccessLogConfig
Name of the logger used to obtain access log logger fromSystem.getLogger(String)
. Defaults to "io.helidon.webserver.AccessLog".- Specified by:
loggerName
in interfaceAccessLogConfig
- Returns:
- name of the logger to use
-
weight
public double weight()Description copied from interface:AccessLogConfig
Weight of the access log feature. We need to log access for anything happening on the server, so weight is high: 1000.0.- Specified by:
weight
in interfaceAccessLogConfig
- Returns:
- weight of the feature
-
sockets
Description copied from interface:AccessLogConfig
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.- Specified by:
sockets
in interfaceAccessLogConfig
- Returns:
- socket names to register on, defaults to empty (all available sockets)
-
name
Description copied from interface:AccessLogConfig
Name of this instance.- Specified by:
name
in interfaceAccessLogConfig
- Returns:
- instance name
-
format
Description copied from interface:AccessLogConfig
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
- Specified by:
format
in interfaceAccessLogConfig
- Returns:
- format string, such as
%h %l %u %t %r %b %{Referer}i
-
enabled
public boolean enabled()Description copied from interface:AccessLogConfig
Whether this feature will be enabled.- Specified by:
enabled
in interfaceAccessLogConfig
- Returns:
- whether enabled
-
toString
-
equals
-
hashCode
public int hashCode()
-