Class LoggingChannelListener


  • public class LoggingChannelListener
    extends Channel.Listener
    Channel listener which merely formats events to a logger.
    Since:
    3.17
    • Constructor Detail

      • LoggingChannelListener

        public LoggingChannelListener​(Logger logger,
                                      Level level)
    • Method Detail

      • onClosed

        public void onClosed​(Channel channel,
                             IOException cause)
        Description copied from class: Channel.Listener
        When the channel was closed normally or abnormally due to an error.
        Overrides:
        onClosed in class Channel.Listener
        cause - if the channel is closed abnormally, this parameter represents an exception that has triggered it. Otherwise null.
      • onRead

        public void onRead​(Channel channel,
                           Command cmd,
                           long blockSize)
        Description copied from class: Channel.Listener
        Called when a command is successfully received by a channel.
        Overrides:
        onRead in class Channel.Listener
        Parameters:
        channel - a channel
        cmd - a command
        blockSize - the number of bytes used to read this command
      • onResponse

        public void onResponse​(Channel channel,
                               Request<?,​?> req,
                               Response<?,​?> rsp,
                               long totalTime)
        Description copied from class: Channel.Listener
        Called when a response has been read from a channel.
        Overrides:
        onResponse in class Channel.Listener
        Parameters:
        channel - a channel
        req - the original request
        rsp - the resulting response
        totalTime - the total time in nanoseconds taken to service the request