io.vertx.ext.web.handler

## Interface LoggerHandler

- All Superinterfaces:
    Handler<RoutingContext>, PlatformHandler

      public interface LoggerHandler
      extends 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
  Author:
    Tim Fox, Paulo Lopes

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static LoggerFormat` | `DEFAULT_FORMAT`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static LoggerHandler` | `create()` Create a handler with default format
    `static LoggerHandler` | `create(boolean immediate, LoggerFormat format)` Create a handler with he specified format
    `static LoggerHandler` | `create(LoggerFormat format)` Create a handler with he specified format
    `LoggerHandler` | `customFormatter(java.util.function.Function<HttpServerRequest,String> formatter)` Deprecated. Superseded by `customFormatter(LoggerFormatter)`
    `LoggerHandler` | `customFormatter(LoggerFormatter formatter)` Set the custom formatter to be used by the handler.

    - ### Methods inherited from interface io.vertx.core.Handler

      `handle`

- - ### Field Detail

    - #### DEFAULT_FORMAT

          static final LoggerFormat DEFAULT_FORMAT

  - ### Method Detail

    - #### create

          static LoggerHandler create()

      Create a handler with default format
      Returns:
        the handler

    - #### create

          static LoggerHandler create(LoggerFormat format)

      Create a handler with he specified format
      Parameters:
        `format` - the format
      Returns:
        the handler

    - #### create

          static LoggerHandler create(boolean immediate,
                                      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

          @Deprecated
          LoggerHandler customFormatter(java.util.function.Function<HttpServerRequest,String> formatter)

      Deprecated. Superseded by `customFormatter(LoggerFormatter)`
      Set the custom formatter to be used by the handler.
      Parameters:
        `formatter` - the formatting function
      Returns:
        the formatted log string
      Throws:
        `IllegalStateException` - if current format is not `LoggerFormat.CUSTOM`

    - #### customFormatter

          LoggerHandler customFormatter(LoggerFormatter formatter)

      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 not `LoggerFormat.CUSTOM`

Copyright © 2022 Eclipse. All rights reserved.