Netty 4.0.0.Beta1을 사용하여 들어오는/나가는 HTTP 트래픽을 Netty 기반 서버에 기록하는 가장 좋은 방법은 무엇입니까? 내 파이프 라인은 현재 :Netty 4.0.0.Beta1에서 HTTP 요청/응답을 어떻게 기록합니까?
p.addLast("decoder", new HttpRequestDecoder());
p.addLast("aggregator", new HttpObjectAggregator(1048576));
p.addLast("encoder", new HttpResponseEncoder());
p.addLast("handler", new MyBusinessLogicHandler());
내가 ChannelInboundMessageHandler<FullHttpRequest>
를 구현하는 핸들러를 작성했는데, 다음 않는 들어오는 요청에 대해 잘 작동하는 것 같다,하지만 권장되는 방법 있다는 것입니다 inboundBufferUpdated(ChannelHandlerContext ctx)
방법에 로깅?
ChannelOutboundMessageHandler<FullHttpResponse>
을 구현하려고 시도했을 때 flush(ChannelHandlerContext ctx, ChannelPromise promise)
메서드 내에서 실제 FullHttpResponse 개체를 보지 못했습니다.
제안 사항? 감사!
그래서 로깅 핸들러를 배치하는 위치와 관련하여 간단한 문제가 있음을 알게되었습니다. 나는 여전히'ChannelInboundMessageHandler'&'ChannelOutboundMessageHandler '를 구현하고있다. 이것이 최선의 접근 방법입니까? –
Baron
예. 이렇게하는 것이 가장 좋은 방법입니다. –