Home / Class/ LoggingHandler Class — netty Architecture

LoggingHandler Class — netty Architecture

Architecture documentation for the LoggingHandler class in LoggingHandler.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  903fdc2e_3479_24cf_32a1_f42c47a42f04["LoggingHandler"]
  1c1cc47d_792d_3dcc_b0b9_ae08e7b20fef["LoggingHandler.java"]
  903fdc2e_3479_24cf_32a1_f42c47a42f04 -->|defined in| 1c1cc47d_792d_3dcc_b0b9_ae08e7b20fef
  8df09a72_141e_3e23_a746_9aa8a1b35707["LoggingHandler()"]
  903fdc2e_3479_24cf_32a1_f42c47a42f04 -->|method| 8df09a72_141e_3e23_a746_9aa8a1b35707
  c56484dd_a7ed_cd12_9a8d_2bd341a442dd["LogLevel()"]
  903fdc2e_3479_24cf_32a1_f42c47a42f04 -->|method| c56484dd_a7ed_cd12_9a8d_2bd341a442dd
  16479304_5874_e1c6_b725_31198699bdc7["ByteBufFormat()"]
  903fdc2e_3479_24cf_32a1_f42c47a42f04 -->|method| 16479304_5874_e1c6_b725_31198699bdc7
  876ec73f_69fa_3eac_f26c_4f9590cc03bf["channelRegistered()"]
  903fdc2e_3479_24cf_32a1_f42c47a42f04 -->|method| 876ec73f_69fa_3eac_f26c_4f9590cc03bf
  ce588265_f3ac_f702_b86f_f9e1c2ea6df5["channelUnregistered()"]
  903fdc2e_3479_24cf_32a1_f42c47a42f04 -->|method| ce588265_f3ac_f702_b86f_f9e1c2ea6df5
  aaa9869a_27b2_0df7_3414_f521347b85cb["channelActive()"]
  903fdc2e_3479_24cf_32a1_f42c47a42f04 -->|method| aaa9869a_27b2_0df7_3414_f521347b85cb
  fec87954_1ea3_ce32_4c72_54281234a336["channelInactive()"]
  903fdc2e_3479_24cf_32a1_f42c47a42f04 -->|method| fec87954_1ea3_ce32_4c72_54281234a336
  1d30b067_32c4_ff63_f006_167d3fc0b888["exceptionCaught()"]
  903fdc2e_3479_24cf_32a1_f42c47a42f04 -->|method| 1d30b067_32c4_ff63_f006_167d3fc0b888
  96a73677_95b3_c93f_3888_36bfa8ccf035["userEventTriggered()"]
  903fdc2e_3479_24cf_32a1_f42c47a42f04 -->|method| 96a73677_95b3_c93f_3888_36bfa8ccf035
  7626221a_f326_ed25_15de_65bf0f928fa2["bind()"]
  903fdc2e_3479_24cf_32a1_f42c47a42f04 -->|method| 7626221a_f326_ed25_15de_65bf0f928fa2
  94e6a70d_2c97_8adc_71ae_ae8aba303d76["connect()"]
  903fdc2e_3479_24cf_32a1_f42c47a42f04 -->|method| 94e6a70d_2c97_8adc_71ae_ae8aba303d76
  8906cc10_6db3_32be_426f_18efa25f92c8["disconnect()"]
  903fdc2e_3479_24cf_32a1_f42c47a42f04 -->|method| 8906cc10_6db3_32be_426f_18efa25f92c8
  522efdf0_c566_3a1a_e891_37ecd01a5201["close()"]
  903fdc2e_3479_24cf_32a1_f42c47a42f04 -->|method| 522efdf0_c566_3a1a_e891_37ecd01a5201

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/logging/LoggingHandler.java lines 40–427

@Sharable
@SuppressWarnings({ "StringConcatenationInsideStringBufferAppend", "StringBufferReplaceableByString" })
public class LoggingHandler extends ChannelDuplexHandler {

    private static final LogLevel DEFAULT_LEVEL = LogLevel.DEBUG;

    protected final InternalLogger logger;
    protected final InternalLogLevel internalLevel;

    private final LogLevel level;
    private final ByteBufFormat byteBufFormat;

    /**
     * Creates a new instance whose logger name is the fully qualified class
     * name of the instance with hex dump enabled.
     */
    public LoggingHandler() {
        this(DEFAULT_LEVEL);
    }
    /**
     * Creates a new instance whose logger name is the fully qualified class
     * name of the instance.
     *
     * @param format Format of ByteBuf dumping
     */
    public LoggingHandler(ByteBufFormat format) {
        this(DEFAULT_LEVEL, format);
    }

    /**
     * Creates a new instance whose logger name is the fully qualified class
     * name of the instance.
     *
     * @param level the log level
     */
    public LoggingHandler(LogLevel level) {
        this(level, ByteBufFormat.HEX_DUMP);
    }

    /**
     * Creates a new instance whose logger name is the fully qualified class
     * name of the instance.
     *
     * @param level the log level
     * @param byteBufFormat the ByteBuf format
     */
    public LoggingHandler(LogLevel level, ByteBufFormat byteBufFormat) {
        this.level = ObjectUtil.checkNotNull(level, "level");
        this.byteBufFormat = ObjectUtil.checkNotNull(byteBufFormat, "byteBufFormat");
        logger = InternalLoggerFactory.getInstance(getClass());
        internalLevel = level.toInternalLevel();
    }

    /**
     * Creates a new instance with the specified logger name and with hex dump
     * enabled.
     *
     * @param clazz the class type to generate the logger for
     */
    public LoggingHandler(Class<?> clazz) {
        this(clazz, DEFAULT_LEVEL);
    }

    /**
     * Creates a new instance with the specified logger name.
     *
     * @param clazz the class type to generate the logger for
     * @param level the log level
     */
    public LoggingHandler(Class<?> clazz, LogLevel level) {
        this(clazz, level, ByteBufFormat.HEX_DUMP);
    }

    /**
     * Creates a new instance with the specified logger name.
     *
     * @param clazz the class type to generate the logger for
     * @param level the log level
     * @param byteBufFormat the ByteBuf format
     */
    public LoggingHandler(Class<?> clazz, LogLevel level, ByteBufFormat byteBufFormat) {

Frequently Asked Questions

What is the LoggingHandler class?
LoggingHandler is a class in the netty codebase, defined in handler/src/main/java/io/netty/handler/logging/LoggingHandler.java.
Where is LoggingHandler defined?
LoggingHandler is defined in handler/src/main/java/io/netty/handler/logging/LoggingHandler.java at line 40.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free