ChannelHandler that logs all events using a logging framework.
By default, all events are logged at DEBUG level and full hex dumps are recorded for ByteBufs.
| Modifier and Type | Field and Description |
|---|---|
| private final ByteBufFormat | |
| private static final LogLevel | |
| protected final InternalLogLevel | |
| private final LogLevel | |
| protected final InternalLogger |
| Access | Constructor and Description |
|---|---|
| public | LoggingHandler()
Creates a new instance whose logger name is the fully qualified class name of the instance with hex dump enabled. |
| public | LoggingHandler(ByteBufFormat
Format of ByteBuf dumping format)Creates a new instance whose logger name is the fully qualified class name of the instance. |
| public | LoggingHandler(LogLevel
the log level level)Creates a new instance whose logger name is the fully qualified class name of the instance. |
| public | LoggingHandler(LogLevel
the log level level, ByteBufFormat the ByteBuf format byteBufFormat)Creates a new instance whose logger name is the fully qualified class name of the instance. |
| public | LoggingHandler(Class<?>
the class type to generate the logger for clazz)Creates a new instance with the specified logger name and with hex dump enabled. |
| public | LoggingHandler(Class<?>
the class type to generate the logger for clazz, LogLevel the log level level)Creates a new instance with the specified logger name. |
| public | LoggingHandler(Class<?>
the class type to generate the logger for clazz, LogLevel the log level level, ByteBufFormat the ByteBuf format byteBufFormat)Creates a new instance with the specified logger name. |
| public | LoggingHandler(String
the name of the class to use for the logger name)Creates a new instance with the specified logger name using the default log level. |
| public | LoggingHandler(String
the name of the class to use for the logger name, LogLevel the log level level)Creates a new instance with the specified logger name. |
| public | LoggingHandler(String
the name of the class to use for the logger name, LogLevel the log level level, ByteBufFormat the ByteBuf format byteBufFormat)Creates a new instance with the specified logger name. |
| byteBufFormat | back to summary |
|---|---|
| private final ByteBufFormat byteBufFormat | |
| DEFAULT_LEVEL | back to summary |
|---|---|
| private static final LogLevel DEFAULT_LEVEL | |
| internalLevel | back to summary |
|---|---|
| protected final InternalLogLevel internalLevel | |
| level | back to summary |
|---|---|
| private final LogLevel level | |
| logger | back to summary |
|---|---|
| protected final InternalLogger logger | |
| LoggingHandler | back to summary |
|---|---|
| public LoggingHandler() Creates a new instance whose logger name is the fully qualified class name of the instance with hex dump enabled. | |
| LoggingHandler | back to summary |
|---|---|
| public LoggingHandler(ByteBufFormat format) Creates a new instance whose logger name is the fully qualified class name of the instance.
| |
| LoggingHandler | back to summary |
|---|---|
| public LoggingHandler(LogLevel level) Creates a new instance whose logger name is the fully qualified class name of the instance.
| |
| LoggingHandler | back to summary |
|---|---|
| public LoggingHandler(LogLevel level, ByteBufFormat byteBufFormat) Creates a new instance whose logger name is the fully qualified class name of the instance.
| |
| LoggingHandler | back to summary |
|---|---|
| public LoggingHandler(Class<?> clazz) Creates a new instance with the specified logger name and with hex dump enabled.
| |
| LoggingHandler | back to summary |
|---|---|
| public LoggingHandler(Class<?> clazz, LogLevel level) Creates a new instance with the specified logger name. | |
| LoggingHandler | back to summary |
|---|---|
| public LoggingHandler(Class<?> clazz, LogLevel level, ByteBufFormat byteBufFormat) Creates a new instance with the specified logger name.
| |
| LoggingHandler | back to summary |
|---|---|
| public LoggingHandler(String name) Creates a new instance with the specified logger name using the default log level.
| |
| LoggingHandler | back to summary |
|---|---|
| public LoggingHandler(String name, LogLevel level) Creates a new instance with the specified logger name. | |
| LoggingHandler | back to summary |
|---|---|
| public LoggingHandler(String name, LogLevel level, ByteBufFormat byteBufFormat) Creates a new instance with the specified logger name.
| |
| byteBufFormat | back to summary |
|---|---|
| public ByteBufFormat byteBufFormat() Returns the | |
| channelActive | back to summary |
|---|---|
| public void channelActive(ChannelHandlerContext ctx) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| channelInactive | back to summary |
|---|---|
| public void channelInactive(ChannelHandlerContext ctx) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| channelRead | back to summary |
|---|---|
| public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| channelReadComplete | back to summary |
|---|---|
| public void channelReadComplete(ChannelHandlerContext ctx) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| channelRegistered | back to summary |
|---|---|
| public void channelRegistered(ChannelHandlerContext ctx) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| channelUnregistered | back to summary |
|---|---|
| public void channelUnregistered(ChannelHandlerContext ctx) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| channelWritabilityChanged | back to summary |
|---|---|
| public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| close | back to summary |
|---|---|
| public void close(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| deregister | back to summary |
|---|---|
| public void deregister(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| disconnect | back to summary |
|---|---|
| public void disconnect(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| exceptionCaught | back to summary |
|---|---|
| public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception Overrides io. Implements io. Doc from io. Gets called if a
| |
| flush | back to summary |
|---|---|
| public void flush(ChannelHandlerContext ctx) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| format | back to summary |
|---|---|
| protected String format(ChannelHandlerContext ctx, String eventName) Formats an event and returns the formatted message.
| |
| format | back to summary |
|---|---|
| protected String format(ChannelHandlerContext ctx, String eventName, Object arg) Formats an event and returns the formatted message. | |
| format | back to summary |
|---|---|
| protected String format(ChannelHandlerContext ctx, String eventName, Object firstArg, Object secondArg) Formats an event and returns the formatted message. This method is currently only used for formatting
| |
| formatByteBuf | back to summary |
|---|---|
| private String formatByteBuf(ChannelHandlerContext ctx, String eventName, ByteBuf msg) Generates the default log message of the specified event whose argument is a | |
| formatByteBufHolder | back to summary |
|---|---|
| private String formatByteBufHolder(ChannelHandlerContext ctx, String eventName, ByteBufHolder msg) Generates the default log message of the specified event whose argument is a | |
| formatSimple | back to summary |
|---|---|
| private static String formatSimple(ChannelHandlerContext ctx, String eventName, Object msg) Generates the default log message of the specified event whose argument is an arbitrary object. | |
| level | back to summary |
|---|---|
| public LogLevel level() Returns the | |
| userEventTriggered | back to summary |
|---|---|
| public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| write | back to summary |
|---|---|
| public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception Overrides io. Implements io. Doc from io. Calls
| |