AccessLogReceiver.
This handler can log any attribute that is provides via the io.
mechanism. A general guide to the most common attribute is provided before, however this mechanism is extensible.
This factory produces token handlers for the following patterns
In addition, the caller can specify one of the following aliases for commonly utilized patterns:
%h %l %u %t "%r" %s %b
%h %l %u %t "%r" %s %b "%{i,Referer}" "%{i,User-Agent}"
%o %l %u %t "%r" %s %b
%o %l %u %t "%r" %s %b "%{i,Referer}" "%{i,User-Agent}"
There is also support to write information from the cookie, incoming
header, or the session
It is modeled after the apache syntax:
%{i,xxx} for incoming headers
%{o,xxx} for outgoing response headers
%{c,xxx} for a specific cookie
%{r,xxx} xxx is an attribute in the ServletRequest
%{s,xxx} xxx is an attribute in the HttpSession
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| public static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final AccessLogReceiver | |
| private final ExchangeCompletionListener | |
| private final String | |
| private final HttpHandler | |
| private final Predicate | |
| private final ExchangeAttribute |
| Access | Constructor and Description |
|---|---|
| public | AccessLogHandler(final HttpHandler next, final AccessLogReceiver accessLogReceiver, final String formatString, ClassLoader classLoader)
|
| public | AccessLogHandler(final HttpHandler next, final AccessLogReceiver accessLogReceiver, final String formatString, ClassLoader classLoader, Predicate predicate)
|
| public | AccessLogHandler(final HttpHandler next, final AccessLogReceiver accessLogReceiver, String formatString, final ExchangeAttribute attribute)
|
| public | AccessLogHandler(final HttpHandler next, final AccessLogReceiver accessLogReceiver, String formatString, final ExchangeAttribute attribute, Predicate predicate)
|
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| public void | handleRequest(final HttpServerExchange
the HTTP request/response exchange exchange)Implements io. Handle the request. |
| public String |
| accessLogReceiver | back to summary |
|---|---|
| private final AccessLogReceiver accessLogReceiver | |
| exchangeCompletionListener | back to summary |
|---|---|
| private final ExchangeCompletionListener exchangeCompletionListener | |
| formatString | back to summary |
|---|---|
| private final String formatString | |
| next | back to summary |
|---|---|
| private final HttpHandler next | |
| predicate | back to summary |
|---|---|
| private final Predicate predicate | |
| tokens | back to summary |
|---|---|
| private final ExchangeAttribute tokens | |
| AccessLogHandler | back to summary |
|---|---|
| public AccessLogHandler(final HttpHandler next, final AccessLogReceiver accessLogReceiver, final String formatString, ClassLoader classLoader) | |
| AccessLogHandler | back to summary |
|---|---|
| public AccessLogHandler(final HttpHandler next, final AccessLogReceiver accessLogReceiver, final String formatString, ClassLoader classLoader, Predicate predicate) | |
| AccessLogHandler | back to summary |
|---|---|
| public AccessLogHandler(final HttpHandler next, final AccessLogReceiver accessLogReceiver, String formatString, final ExchangeAttribute attribute) | |
| AccessLogHandler | back to summary |
|---|---|
| public AccessLogHandler(final HttpHandler next, final AccessLogReceiver accessLogReceiver, String formatString, final ExchangeAttribute attribute, Predicate predicate) | |
| handleCommonNames | back to summary |
|---|---|
| private static String handleCommonNames(String formatString) | |
| handleRequest | back to summary |
|---|---|
| public void handleRequest(final HttpServerExchange exchange) throws Exception Implements io. Doc from io. Handle the request.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | exchangeEvent(final HttpServerExchange exchange, final ExchangeCompletionListener.
Implements io.
|
| AccessLogCompletionListener | back to summary |
|---|---|
| private AccessLogCompletionListener() | |
| exchangeEvent | back to summary |
|---|---|
| public void exchangeEvent(final HttpServerExchange exchange, final ExchangeCompletionListener. Implements io.
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public HandlerWrapper | build(Map<String, Object>
The handler config config)Implements io. Creates the handler |
| public String | |
| public String | name()
Implements io. The string representation of the handler name. |
| public Map | parameters()
Implements io. Returns a map of parameters and their types. |
| public Set |
| Builder | back to summary |
|---|---|
| public Builder() | |
| build | back to summary |
|---|---|
| public HandlerWrapper build(Map<String, Object> config) Implements io. Doc from io. Creates the handler
| |
| defaultParameter | back to summary |
|---|---|
| public String defaultParameter() Implements io.
| |
| name | back to summary |
|---|---|
| public String name() Implements io. Doc from io. The string representation of the handler name. | |
| parameters | back to summary |
|---|---|
| public Map Implements io. Doc from io. Returns a map of parameters and their types.
| |
| requiredParameters | back to summary |
|---|---|
| public Set Implements io.
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public HttpHandler |
| category | back to summary |
|---|---|
| private final String category | |
| format | back to summary |
|---|---|
| private final String format | |
| Wrapper | back to summary |
|---|---|
| private Wrapper(String format, String category) | |
| wrap | back to summary |
|---|---|
| public HttpHandler wrap(HttpHandler handler) Implements io.
| |