Package io.vertx.mutiny.ext.web.handler
Class LoggerHandler
java.lang.Object
io.vertx.mutiny.ext.web.handler.LoggerHandler
- All Implemented Interfaces:
MutinyDelegate,io.vertx.core.Handler<RoutingContext>,PlatformHandler,Consumer<RoutingContext>
public class LoggerHandler
extends Object
implements io.vertx.core.Handler<RoutingContext>, PlatformHandler, Consumer<RoutingContext>, MutinyDelegate
A handler which logs request information to the Vert.x logger.
You should mount this handler before any handler that could fail the routing context.
Logs will be produced with the appropriate severity level depending on the status code of the response.
To capture the logs configure the logger in your logging configuration with the name:
io.vertx.ext.web.handler.LoggerHandler.
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Tim Fox, Paulo Lopes
- See Also:
-
LoggerHandler
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vertx.mutiny.ext.web.handler.PlatformHandler
PlatformHandler.PlatformHandlerImpl -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TypeArg<LoggerHandler>static final io.vertx.ext.web.handler.LoggerFormat -
Constructor Summary
ConstructorsConstructorDescriptionLoggerHandler(io.vertx.ext.web.handler.LoggerHandler delegate) Create a new instance ofLoggerHandlerdelegating to the given (non-null) instance ofLoggerHandler.LoggerHandler(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(RoutingContext item) Handle an item.static LoggerHandlercreate()Create a handler with default formatstatic LoggerHandlercreate(boolean immediate, io.vertx.ext.web.handler.LoggerFormat format) Create a handler with he specified formatstatic LoggerHandlercreate(io.vertx.ext.web.handler.LoggerFormat format) Create a handler with he specified formatcustomFormatter(LoggerFormatter formatter) Set the custom formatter to be used by the handler.booleanio.vertx.ext.web.handler.LoggerHandlerGet the delegate instance.voidhandle(RoutingContext item) Handle an item.inthashCode()static LoggerHandlernewInstance(io.vertx.ext.web.handler.LoggerHandler delegate) Creates a new instance of theLoggerHandler.toString()
-
Field Details
-
DEFAULT_FORMAT
public static final io.vertx.ext.web.handler.LoggerFormat DEFAULT_FORMAT -
__TYPE_ARG
-
-
Constructor Details
-
LoggerHandler
public LoggerHandler(io.vertx.ext.web.handler.LoggerHandler delegate) Create a new instance ofLoggerHandlerdelegating to the given (non-null) instance ofLoggerHandler. -
LoggerHandler
-
-
Method Details
-
accept
Handle an item. This method is generated from theoriginalmethod."- Specified by:
acceptin interfaceConsumer<RoutingContext>- Specified by:
acceptin interfacePlatformHandler
-
handle
Handle an item. This method is generated from theoriginalmethod."- Specified by:
handlein interfaceio.vertx.core.Handler<RoutingContext>- Specified by:
handlein interfacePlatformHandler
-
getDelegate
public io.vertx.ext.web.handler.LoggerHandler getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Specified by:
getDelegatein interfacePlatformHandler- Returns:
- the delegate instance
-
create
Create a handler with default format- Returns:
- the handler
-
create
Create a handler with he specified format- Parameters:
format- the format- Returns:
- the handler
-
create
Create a handler with he specified format- Parameters:
immediate- true if logging should occur as soon as request arrivesformat- the format- Returns:
- the handler
-
customFormatter
Set the custom formatter to be used by the handler.- Parameters:
formatter- the formatter- Returns:
- the formatted log string
-
newInstance
Creates a new instance of theLoggerHandler. -
hashCode
public int hashCode() -
equals
-
toString
-