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
  • Field Details

    • DEFAULT_FORMAT

      public static final io.vertx.ext.web.handler.LoggerFormat DEFAULT_FORMAT
    • __TYPE_ARG

      public static final TypeArg<LoggerHandler> __TYPE_ARG
  • Constructor Details

    • LoggerHandler

      public LoggerHandler(io.vertx.ext.web.handler.LoggerHandler delegate)
      Create a new instance of LoggerHandler delegating to the given (non-null) instance of LoggerHandler.
    • LoggerHandler

      public LoggerHandler(Object delegate)
  • Method Details

    • accept

      public void accept(RoutingContext item)
      Handle an item. This method is generated from the original method."
      Specified by:
      accept in interface Consumer<RoutingContext>
      Specified by:
      accept in interface PlatformHandler
    • handle

      public void handle(RoutingContext item)
      Handle an item. This method is generated from the original method."
      Specified by:
      handle in interface io.vertx.core.Handler<RoutingContext>
      Specified by:
      handle in interface PlatformHandler
    • 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:
      getDelegate in interface MutinyDelegate
      Specified by:
      getDelegate in interface PlatformHandler
      Returns:
      the delegate instance
    • create

      public static LoggerHandler create()
      Create a handler with default format
      Returns:
      the handler
    • create

      public static LoggerHandler create(io.vertx.ext.web.handler.LoggerFormat format)
      Create a handler with he specified format
      Parameters:
      format - the format
      Returns:
      the handler
    • create

      public static LoggerHandler create(boolean immediate, io.vertx.ext.web.handler.LoggerFormat format)
      Create a handler with he specified format
      Parameters:
      immediate - true if logging should occur as soon as request arrives
      format - the format
      Returns:
      the handler
    • customFormatter

      public LoggerHandler customFormatter(LoggerFormatter formatter)
      Set the custom formatter to be used by the handler.
      Parameters:
      formatter - the formatter
      Returns:
      the formatted log string
    • newInstance

      public static LoggerHandler newInstance(io.vertx.ext.web.handler.LoggerHandler delegate)
      Creates a new instance of the LoggerHandler.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object