Vert.x - Web Logger

Java Conceptuel Diagram

About

Web - Log (Http log) in Vert.x

LoggerHandler is a handler which logs request information to the Vert.x logger.

Example

Example with the DEFAULT LoggerFormat.

Vertx vertx = Vertx.vertx();
HttpServer httpServer = vertx.createHttpServer();
Router router = Router.router(vertx);

// The handler
router.route().handler(LoggerHandler.create(LoggerFormat.DEFAULT));

httpServer.requestHandler(router::accept).listen(8080);

Format

Note: LoggerHandler is a static factory that returns the implementation LoggerHandlerImpl (code).

It support only three formats that are define via the LoggerFormat.

In version 4, you should be able to override the log method to add your own format. See issue

Format:

remote-client - - [timestamp] "method uri version" status content-length "referrer" "user-agent"

  • SHORT
remote-client - method uri version status content-length duration ms

  • TINY
method uri status - content-length duration





Discover More
Java Conceptuel Diagram
Vert.x - Logger

logging in Vertx is managed by the Vertx Logger The Vertx logger is a facade for logging system. It uses the JUL logger as default logging...



Share this page:
Follow us:
Task Runner