@Override
        public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
            if (evt instanceof HttpLifecycleChannelHandler.CompleteEvent) {
                // Get the stored request, and remove the attr from channel to cleanup.
                RequestState state = ctx.channel().attr(ATTR_REQ_STATE).get();
                ctx.channel().attr(ATTR_REQ_STATE).set(null);

                // Response complete, so now write to access log.
                long durationNs = System.nanoTime() - state.startTimeNs;

                Integer localPort = getLocalPort(ctx);
                String remoteIp = getRemoteIp(ctx);

                if (state.response == null) {
                    LOG.debug(
                            "Response null in AccessLog, Complete reason={}, duration={}, url={}, method={}",
                            ((HttpLifecycleChannelHandler.CompleteEvent) evt).getReason(),
                            durationNs / (1000 * 1000),
                            state.request != null ? state.request.uri() : "-",
                            state.request != null ? state.request.method() : "-");
                }

                publisher.log(
                        ctx.channel(),
                        state.request,
                        state.response,
                        state.dateTime,
                        localPort,
                        remoteIp,
                        durationNs,
                        state.requestBodySize,
                        state.responseBodySize);
            }

            super.userEventTriggered(ctx, evt);
        }
User: michaels@netflix.com
Date: 4/14/16
Time: 3:51 PM
zuul-core/src/main/java/com/netflix/netty/common/accesslog/AccessLogChannelHandler.java