Interface LoggerHandler
- All Superinterfaces:
Handler<RoutingContext>, PlatformHandler
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.- Author:
- Tim Fox, Paulo Lopes
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic LoggerHandlercreate()Create a handler with default formatstatic LoggerHandlercreate(boolean immediate, LoggerFormat format) Create a handler with he specified formatstatic LoggerHandlercreate(LoggerFormat format) Create a handler with he specified formatcustomFormatter(LoggerFormatter formatter) Set the custom formatter to be used by the handler.
-
Field Details
-
DEFAULT_FORMAT
-
-
Method Details
-
create
-
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
- Throws:
IllegalStateException- if current format is notLoggerFormat.CUSTOM
-