@Override
  public void log(ChannelEvent e) {
    StringBuilder sb = new StringBuilder();

    // System.out.println(e);
    if (e instanceof DownstreamMessageEvent) {
      DownstreamMessageEvent devm = (DownstreamMessageEvent) e;
      Object mes = devm.getMessage();
      sb.append('[');
      sb.append(e.getChannel().getId());
      sb.append(" >out> ");
      if (mes instanceof ChannelBuffer)
        encodeBuffer((ChannelBuffer) ((DownstreamMessageEvent) e).getMessage(), sb);
      else sb.append(mes.toString());
    } else if (e instanceof UpstreamMessageEvent) {
      sb.append(e.getChannel().getId());
      sb.append(" <in< ");
      Object message = ((UpstreamMessageEvent) e).getMessage();
      if (message instanceof ChannelBuffer)
        encodeBuffer((ChannelBuffer) ((UpstreamMessageEvent) e).getMessage(), sb);
    } else if (e instanceof ExceptionEvent) {
      sb.append(e.toString());
    } else sb.append(e.toString());

    Constants.ahessianLogger.info(sb.toString());
  }
 @Override
 public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e) throws Exception {
   if (e instanceof ChannelStateEvent) {
     logger.info(e.toString());
   }
   super.handleUpstream(ctx, e);
 }
Exemple #3
0
 @Override
 public void handleUpstream(final ChannelHandlerContext ctx, final ChannelEvent e)
     throws Exception {
   if (LOG.isDebugEnabled()) {
     LOG.debug(getPeerUuidLoggingString() + e.toString());
   }
   super.handleUpstream(ctx, e);
 }