|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.netty.handler.logging.LoggingHandler
@ChannelHandler.Sharable public class LoggingHandler
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler |
---|
ChannelHandler.Sharable |
Constructor Summary | |
---|---|
LoggingHandler()
Creates a new instance whose logger name is the fully qualified class name of the instance with hex dump enabled. |
|
LoggingHandler(boolean hexDump)
Creates a new instance whose logger name is the fully qualified class name of the instance. |
|
LoggingHandler(Class<?> clazz)
Creates a new instance with the specified logger name and with hex dump enabled. |
|
LoggingHandler(Class<?> clazz,
boolean hexDump)
Creates a new instance with the specified logger name. |
|
LoggingHandler(Class<?> clazz,
InternalLogLevel level)
Creates a new instance with the specified logger name. |
|
LoggingHandler(Class<?> clazz,
InternalLogLevel level,
boolean hexDump)
Creates a new instance with the specified logger name. |
|
LoggingHandler(InternalLogLevel level)
Creates a new instance whose logger name is the fully qualified class name of the instance. |
|
LoggingHandler(InternalLogLevel level,
boolean hexDump)
Creates a new instance whose logger name is the fully qualified class name of the instance. |
|
LoggingHandler(String name)
Creates a new instance with the specified logger name and with hex dump enabled. |
|
LoggingHandler(String name,
boolean hexDump)
Creates a new instance with the specified logger name. |
|
LoggingHandler(String name,
InternalLogLevel level,
boolean hexDump)
Creates a new instance with the specified logger name. |
Method Summary | |
---|---|
InternalLogLevel |
getLevel()
Returns the InternalLogLevel that this handler uses to log
a ChannelEvent . |
InternalLogger |
getLogger()
Returns the InternalLogger that this handler uses to log
a ChannelEvent . |
void |
handleDownstream(ChannelHandlerContext ctx,
ChannelEvent e)
Handles the specified downstream event. |
void |
handleUpstream(ChannelHandlerContext ctx,
ChannelEvent e)
Handles the specified upstream event. |
void |
log(ChannelEvent e)
Logs the specified event to the InternalLogger returned by
getLogger() . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LoggingHandler()
public LoggingHandler(InternalLogLevel level)
level
- the log levelpublic LoggingHandler(boolean hexDump)
hexDump
- true
if and only if the hex dump of the received
message is loggedpublic LoggingHandler(InternalLogLevel level, boolean hexDump)
level
- the log levelhexDump
- true
if and only if the hex dump of the received
message is loggedpublic LoggingHandler(Class<?> clazz)
public LoggingHandler(Class<?> clazz, boolean hexDump)
hexDump
- true
if and only if the hex dump of the received
message is loggedpublic LoggingHandler(Class<?> clazz, InternalLogLevel level)
level
- the log levelpublic LoggingHandler(Class<?> clazz, InternalLogLevel level, boolean hexDump)
level
- the log levelhexDump
- true
if and only if the hex dump of the received
message is loggedpublic LoggingHandler(String name)
public LoggingHandler(String name, boolean hexDump)
hexDump
- true
if and only if the hex dump of the received
message is loggedpublic LoggingHandler(String name, InternalLogLevel level, boolean hexDump)
level
- the log levelhexDump
- true
if and only if the hex dump of the received
message is loggedMethod Detail |
---|
public InternalLogger getLogger()
InternalLogger
that this handler uses to log
a ChannelEvent
.
public InternalLogLevel getLevel()
InternalLogLevel
that this handler uses to log
a ChannelEvent
.
public void log(ChannelEvent e)
InternalLogger
returned by
getLogger()
. If hex dump has been enabled for this handler,
the hex dump of the ChannelBuffer
in a MessageEvent
will
be logged together.
public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e) throws Exception
ChannelUpstreamHandler
handleUpstream
in interface ChannelUpstreamHandler
ctx
- the context object for this handlere
- the upstream event to process or intercept
Exception
public void handleDownstream(ChannelHandlerContext ctx, ChannelEvent e) throws Exception
ChannelDownstreamHandler
handleDownstream
in interface ChannelDownstreamHandler
ctx
- the context object for this handlere
- the downstream event to process or intercept
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |