Class LoggingHandler

java.lang.Object
org.jboss.netty.handler.logging.LoggingHandler
All Implemented Interfaces:
ChannelDownstreamHandler, ChannelHandler, ChannelUpstreamHandler

@Sharable public class LoggingHandler extends Object implements ChannelUpstreamHandler, ChannelDownstreamHandler
A ChannelHandler that logs all events via InternalLogger. By default, all events are logged at DEBUG level. You can extend this class and override log(ChannelEvent) to change the default behavior.
  • Field Details

    • DEFAULT_LEVEL

      private static final InternalLogLevel DEFAULT_LEVEL
    • NEWLINE

      private static final String NEWLINE
    • BYTE2HEX

      private static final String[] BYTE2HEX
    • HEXPADDING

      private static final String[] HEXPADDING
    • BYTEPADDING

      private static final String[] BYTEPADDING
    • BYTE2CHAR

      private static final char[] BYTE2CHAR
    • logger

      private final InternalLogger logger
    • level

      private final InternalLogLevel level
    • hexDump

      private final boolean hexDump
  • Constructor Details

    • LoggingHandler

      public LoggingHandler()
      Creates a new instance whose logger name is the fully qualified class name of the instance with hex dump enabled.
    • LoggingHandler

      public LoggingHandler(InternalLogLevel level)
      Creates a new instance whose logger name is the fully qualified class name of the instance.
      Parameters:
      level - the log level
    • LoggingHandler

      public LoggingHandler(boolean hexDump)
      Creates a new instance whose logger name is the fully qualified class name of the instance.
      Parameters:
      hexDump - true if and only if the hex dump of the received message is logged
    • LoggingHandler

      public LoggingHandler(InternalLogLevel level, boolean hexDump)
      Creates a new instance whose logger name is the fully qualified class name of the instance.
      Parameters:
      level - the log level
      hexDump - true if and only if the hex dump of the received message is logged
    • LoggingHandler

      public LoggingHandler(Class<?> clazz)
      Creates a new instance with the specified logger name and with hex dump enabled.
    • LoggingHandler

      public LoggingHandler(Class<?> clazz, boolean hexDump)
      Creates a new instance with the specified logger name.
      Parameters:
      hexDump - true if and only if the hex dump of the received message is logged
    • LoggingHandler

      public LoggingHandler(Class<?> clazz, InternalLogLevel level)
      Creates a new instance with the specified logger name.
      Parameters:
      level - the log level
    • LoggingHandler

      public LoggingHandler(Class<?> clazz, InternalLogLevel level, boolean hexDump)
      Creates a new instance with the specified logger name.
      Parameters:
      level - the log level
      hexDump - true if and only if the hex dump of the received message is logged
    • LoggingHandler

      public LoggingHandler(String name)
      Creates a new instance with the specified logger name and with hex dump enabled.
    • LoggingHandler

      public LoggingHandler(String name, boolean hexDump)
      Creates a new instance with the specified logger name.
      Parameters:
      hexDump - true if and only if the hex dump of the received message is logged
    • LoggingHandler

      public LoggingHandler(String name, InternalLogLevel level, boolean hexDump)
      Creates a new instance with the specified logger name.
      Parameters:
      level - the log level
      hexDump - true if and only if the hex dump of the received message is logged
  • Method Details