Package io.helidon.webserver.accesslog
Class AccessLogSupport.Builder
java.lang.Object
io.helidon.webserver.accesslog.AccessLogSupport.Builder
- All Implemented Interfaces:
Builder<AccessLogSupport.Builder,
,AccessLogSupport> Supplier<AccessLogSupport>
- Enclosing class:
- AccessLogSupport
public static final class AccessLogSupport.Builder
extends Object
implements Builder<AccessLogSupport.Builder,AccessLogSupport>
A fluent API Builder for
AccessLogSupport
.-
Method Summary
Modifier and TypeMethodDescriptionadd
(AccessLogEntry entry) Add aAccessLogEntry
to the list of log entries creating the format of this access log.build()
Build the instance from this builder.Configure an alternative clock to use, such asClock.fixed(java.time.Instant, java.time.ZoneId)
.Usecommon
log format.Update this builder from configuration.enabled
(boolean enabled) Access logging can be disabled (either through configuration or explicitly in code.excludePaths
(String... excludePaths) List of path patterns to exclude in access log.excludePaths
(List<String> excludePaths) List of path patterns to exclude in access log.Use Helidon log format.logFormatString
(String format) The format for log entries (similar to the ApacheLogFormat
).loggerName
(String loggerName) Name of the logger use to obtain access log logger fromLogger.getLogger(String)
.
-
Method Details
-
build
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<AccessLogSupport.Builder,
AccessLogSupport> - Returns:
- instance of the built type
-
helidonLogFormat
Use Helidon log format.Clears the current log entries and replaces them with Helidon 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
-
logFormatString
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
-
add
Add aAccessLogEntry
to the list of log entries creating the format of this access log. Entries are separated by a space.- Parameters:
entry
- entry to add to the list of format entries- Returns:
- updated builder instance
-
enabled
Access logging can be disabled (either through configuration or explicitly in code.- Parameters:
enabled
- whether to enable (true
) or disable (false
) access logging- Returns:
- updated builder instance
-
config
Update this builder from configuration. In caseformat
is specified in configuration, it would replace the currently configured format in this builder.- Parameters:
config
- configuration with Access log configuration options- Returns:
- updated builder instance
-
loggerName
Name of the logger use to obtain access log logger fromLogger.getLogger(String)
. Defaults to "io.helidon.webserver.AccessLog".- Parameters:
loggerName
- name of the logger to use- Returns:
- updated builder instance
-
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
-
excludePaths
List of path patterns to exclude in access log.- Parameters:
excludePaths
- list of exclude paths- Returns:
- updated builder instance
- See Also:
-
excludePaths
List of path patterns to exclude in access log.- Parameters:
excludePaths
- list of exclude paths- Returns:
- updated builder instance
- See Also:
-