Enum AdvancedByteBufFormat

java.lang.Object
java.lang.Enum<AdvancedByteBufFormat>
reactor.netty.transport.logging.AdvancedByteBufFormat
All Implemented Interfaces:
Serializable, Comparable<AdvancedByteBufFormat>, java.lang.constant.Constable

public enum AdvancedByteBufFormat extends Enum<AdvancedByteBufFormat>
Used to control the format and verbosity of logging for ByteBufs and ByteBufHolders.

Adds TEXTUAL format to io.netty.handler.logging.ByteBufFormat.

Since:
1.0.0
Author:
Maximilian Goeke
  • Enum Constant Details

    • SIMPLE

      public static final AdvancedByteBufFormat SIMPLE
      When wire logging is enabled with this format, only the events will be logged.

      Examples:

       
       reactor.netty.http.HttpTests - [230d3686, L:/0:0:0:0:0:0:0:1:60241 - R:/0:0:0:0:0:0:0:1:60245] REGISTERED
       reactor.netty.http.HttpTests - [230d3686, L:/0:0:0:0:0:0:0:1:60241 - R:/0:0:0:0:0:0:0:1:60245] ACTIVE
       reactor.netty.http.HttpTests - [230d3686, L:/0:0:0:0:0:0:0:1:60241 - R:/0:0:0:0:0:0:0:1:60245] READ: 145B
       reactor.netty.http.HttpTests - [230d3686, L:/0:0:0:0:0:0:0:1:60241 - R:/0:0:0:0:0:0:0:1:60245] WRITE: 38B
       
       
    • HEX_DUMP

      public static final AdvancedByteBufFormat HEX_DUMP
      When wire logging is enabled with this format, both events and content will be logged. The content will be in hex format.

      Examples:

       
       reactor.netty.http.HttpTests - [d5230a14, L:/0:0:0:0:0:0:0:1:60267 - R:/0:0:0:0:0:0:0:1:60269] REGISTERED
       reactor.netty.http.HttpTests - [d5230a14, L:/0:0:0:0:0:0:0:1:60267 - R:/0:0:0:0:0:0:0:1:60269] ACTIVE
       reactor.netty.http.HttpTests - [d5230a14, L:/0:0:0:0:0:0:0:1:60267 - R:/0:0:0:0:0:0:0:1:60269] READ: 145B
                +-------------------------------------------------+
                |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |
       +--------+-------------------------------------------------+----------------+
       |00000000| 50 4f 53 54 20 2f 74 65 73 74 2f 57 6f 72 6c 64 |POST /test/World|
       |00000010| 20 48 54 54 50 2f 31 2e 31 0d 0a 43 6f 6e 74 65 | HTTP/1.1..Conte|
       |00000020| 6e 74 2d 54 79 70 65 3a 20 74 65 78 74 2f 70 6c |nt-Type: text/pl|
       |00000030| 61 69 6e 0d 0a 75 73 65 72 2d 61 67 65 6e 74 3a |ain..user-agent:|
       |00000040| 20 52 65 61 63 74 6f 72 4e 65 74 74 79 2f 64 65 | ReactorNetty/de|
       ...
       reactor.netty.http.HttpTests - [d5230a14, L:/0:0:0:0:0:0:0:1:60267 - R:/0:0:0:0:0:0:0:1:60269] WRITE: 38B
                +-------------------------------------------------+
                |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |
       +--------+-------------------------------------------------+----------------+
       |00000000| 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d |HTTP/1.1 200 OK.|
       |00000010| 0a 63 6f 6e 74 65 6e 74 2d 6c 65 6e 67 74 68 3a |.content-length:|
       |00000020| 20 30 0d 0a 0d 0a                               | 0....          |
       +--------+-------------------------------------------------+----------------+
       
       
    • TEXTUAL

      public static final AdvancedByteBufFormat TEXTUAL
      When wire logging is enabled with this format, both events and content will be logged. The content will be in plain text format.

      Examples:

       
       reactor.netty.http.HttpTests - [02c3db6c, L:/0:0:0:0:0:0:0:1:60317 - R:/0:0:0:0:0:0:0:1:60319] REGISTERED
       reactor.netty.http.HttpTests - [02c3db6c, L:/0:0:0:0:0:0:0:1:60317 - R:/0:0:0:0:0:0:0:1:60319] ACTIVE
       reactor.netty.http.HttpTests - [02c3db6c, L:/0:0:0:0:0:0:0:1:60317 - R:/0:0:0:0:0:0:0:1:60319] READ: 145B POST /test/World HTTP/1.1
       Content-Type: text/plain
       user-agent: ReactorNetty/dev
       ...
       reactor.netty.http.HttpTests - [02c3db6c, L:/0:0:0:0:0:0:0:1:60317 - R:/0:0:0:0:0:0:0:1:60319] WRITE: 38B HTTP/1.1 200 OK
       content-length: 0
       
       
  • Method Details

    • values

      public static AdvancedByteBufFormat[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static AdvancedByteBufFormat valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • toLoggingHandler

      public LoggingHandler toLoggingHandler(String category, LogLevel level, Charset charset)
      Creates the matching LoggingHandler regarding the format.
      Parameters:
      category - the logger category
      level - the logger level
      charset - the charset (only relevant for TEXTUAL)
      Returns:
      a new LoggingHandler reference