Top Description Inners Fields Constructors Methods
io.undertow.server.handlers.accesslog

public Class AccessLogHandler

extends Object
implements HttpHandler
Class Inheritance
All Implemented Interfaces
io.undertow.server.HttpHandler
Imports
java.util.Collections, .HashMap, .Map, .Set, io.undertow.attribute.ExchangeAttribute, .ExchangeAttributes, .SubstituteEmptyWrapper, io.undertow.predicate.Predicate, .Predicates, io.undertow.server.ExchangeCompletionListener, .HandlerWrapper, .HttpHandler, .HttpServerExchange, io.undertow.server.handlers.builder.HandlerBuilder

Access log handler. This handler will generate access log messages based on the provided format string, and pass these messages into the provided AccessLogReceiver.

This handler can log any attribute that is provides via the io.undertow.attribute.ExchangeAttribute 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:

There is also support to write information from the cookie, incoming header, or the session
It is modeled after the apache syntax:

Author
Stuart Douglas

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
public static class
private static class

Field Summary

Modifier and TypeField and Description
private final AccessLogReceiver
private final ExchangeCompletionListener
private final String
private final HttpHandler
private final Predicate
private final ExchangeAttribute

Constructor Summary

AccessConstructor 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)

Method Summary

Modifier and TypeMethod and Description
private static String
handleCommonNames(String formatString)

public void
handleRequest(final HttpServerExchange
the HTTP request/response exchange
exchange
)

Implements io.undertow.server.HttpHandler.handleRequest.

Handle the request.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

accessLogReceiverback to summary
private final AccessLogReceiver accessLogReceiver
exchangeCompletionListenerback to summary
private final ExchangeCompletionListener exchangeCompletionListener
formatStringback to summary
private final String formatString
nextback to summary
private final HttpHandler next
predicateback to summary
private final Predicate predicate
tokensback to summary
private final ExchangeAttribute tokens

Constructor Detail

AccessLogHandlerback to summary
public AccessLogHandler(final HttpHandler next, final AccessLogReceiver accessLogReceiver, final String formatString, ClassLoader classLoader)
AccessLogHandlerback to summary
public AccessLogHandler(final HttpHandler next, final AccessLogReceiver accessLogReceiver, final String formatString, ClassLoader classLoader, Predicate predicate)
AccessLogHandlerback to summary
public AccessLogHandler(final HttpHandler next, final AccessLogReceiver accessLogReceiver, String formatString, final ExchangeAttribute attribute)
AccessLogHandlerback to summary
public AccessLogHandler(final HttpHandler next, final AccessLogReceiver accessLogReceiver, String formatString, final ExchangeAttribute attribute, Predicate predicate)

Method Detail

handleCommonNamesback to summary
private static String handleCommonNames(String formatString)
handleRequestback to summary
public void handleRequest(final HttpServerExchange exchange) throws Exception

Implements io.undertow.server.HttpHandler.handleRequest.

Doc from io.undertow.server.HttpHandler.handleRequest.

Handle the request.

Parameters
exchange:HttpServerExchange

the HTTP request/response exchange

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
io.undertow.server.handlers.accesslog back to summary

private Class AccessLogHandler.AccessLogCompletionListener

extends Object
implements ExchangeCompletionListener
Class Inheritance
  • java.lang.Object
  • io.undertow.server.handlers.accesslog.AccessLogHandler.AccessLogCompletionListener
All Implemented Interfaces
io.undertow.server.ExchangeCompletionListener

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AccessLogCompletionListenerback to summary
private AccessLogCompletionListener()

Method Detail

exchangeEventback to summary
public void exchangeEvent(final HttpServerExchange exchange, final ExchangeCompletionListener.NextListener nextListener)

Implements io.undertow.server.ExchangeCompletionListener.exchangeEvent.

Annotations
@Override
io.undertow.server.handlers.accesslog back to summary

public Class AccessLogHandler.Builder

extends Object
implements HandlerBuilder
Class Inheritance
  • java.lang.Object
  • io.undertow.server.handlers.accesslog.AccessLogHandler.Builder
All Implemented Interfaces
io.undertow.server.handlers.builder.HandlerBuilder

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public HandlerWrapper
build(Map<String, Object>
The handler config
config
)

Implements io.undertow.server.handlers.builder.HandlerBuilder.build.

Creates the handler

public String
public String
name()

Implements io.undertow.server.handlers.builder.HandlerBuilder.name.

The string representation of the handler name.

public Map<String, Class<?>>
parameters()

Implements io.undertow.server.handlers.builder.HandlerBuilder.parameters.

Returns a map of parameters and their types.

public Set<String>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Builderback to summary
public Builder()

Method Detail

buildback to summary
public HandlerWrapper build(Map<String, Object> config)

Implements io.undertow.server.handlers.builder.HandlerBuilder.build.

Doc from io.undertow.server.handlers.builder.HandlerBuilder.build.

Creates the handler

Parameters
config:Map<String, Object>

The handler config

Returns:HandlerWrapper

The new predicate

Annotations
@Override
defaultParameterback to summary
public String defaultParameter()

Implements io.undertow.server.handlers.builder.HandlerBuilder.defaultParameter.

Returns:String

Doc from io.undertow.server.handlers.builder.HandlerBuilder.defaultParameter.

The default parameter name, or null if it does not have a default parameter

Annotations
@Override
nameback to summary
public String name()

Implements io.undertow.server.handlers.builder.HandlerBuilder.name.

Doc from io.undertow.server.handlers.builder.HandlerBuilder.name.

The string representation of the handler name.

Returns:String

The handler name

Annotations
@Override
parametersback to summary
public Map<String, Class<?>> parameters()

Implements io.undertow.server.handlers.builder.HandlerBuilder.parameters.

Doc from io.undertow.server.handlers.builder.HandlerBuilder.parameters.

Returns a map of parameters and their types.

Annotations
@Override
requiredParametersback to summary
public Set<String> requiredParameters()

Implements io.undertow.server.handlers.builder.HandlerBuilder.requiredParameters.

Returns:Set<String>

Doc from io.undertow.server.handlers.builder.HandlerBuilder.requiredParameters.

The required parameters

Annotations
@Override
io.undertow.server.handlers.accesslog back to summary

private Class AccessLogHandler.Wrapper

extends Object
implements HandlerWrapper
Class Inheritance
  • java.lang.Object
  • io.undertow.server.handlers.accesslog.AccessLogHandler.Wrapper
All Implemented Interfaces
io.undertow.server.HandlerWrapper

Field Summary

Modifier and TypeField and Description
private final String
private final String

Constructor Summary

AccessConstructor and Description
private
Wrapper(String format, String category)

Method Summary

Modifier and TypeMethod and Description
public HttpHandler
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

categoryback to summary
private final String category
formatback to summary
private final String format

Constructor Detail

Wrapperback to summary
private Wrapper(String format, String category)

Method Detail

wrapback to summary
public HttpHandler wrap(HttpHandler handler)

Implements io.undertow.server.HandlerWrapper.wrap.

Annotations
@Override