@Override public PipelineContinuationBehavior doChannelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof LastOutboundMessage) { doAccessLogging(ctx); } return PipelineContinuationBehavior.CONTINUE; }
p.addLast(ACCESS_LOG_END_HANDLER_NAME, new AccessLogEndHandler(accessLogger));
p.addLast(ACCESS_LOG_END_HANDLER_NAME, new AccessLogEndHandler(accessLogger));
@Override public PipelineContinuationBehavior doExceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { // TODO: Catch the case where the response was started earlier, and then this exception was thrown before the // response was fully sent. This indicates a broken response (an extremely rare case) and we don't want to // do a normal access log for it. What should we do? Or should the detection be in AccessLogger itself? If // so, what should it do? doAccessLogging(ctx); return PipelineContinuationBehavior.CONTINUE; }
@Override public PipelineContinuationBehavior doExceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { // TODO: Catch the case where the response was started earlier, and then this exception was thrown before the // response was fully sent. This indicates a broken response (an extremely rare case) and we don't want to // do a normal access log for it. What should we do? Or should the detection be in AccessLogger itself? If // so, what should it do? doAccessLogging(ctx); return PipelineContinuationBehavior.CONTINUE; }
@Override public PipelineContinuationBehavior doChannelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof LastOutboundMessage) { doAccessLogging(ctx); } return PipelineContinuationBehavior.CONTINUE; }