From 9496c1a4edf527f52e8ed5f76fe8afd12dcee3c8 Mon Sep 17 00:00:00 2001 From: Scott Blum Date: Tue, 15 Apr 2014 14:32:28 -0400 Subject: [PATCH] HTTP2 example server should also log. Motivation: The HTTP2 example client logs, and it's useful to show what's going on. It'd be sweet if the server did too. Modifications: Added Http2FrameLogger to example server pipeline. Result: HTTP2 example server will log frames. --- .../io/netty/example/http2/client/Http2ClientInitializer.java | 2 +- .../io/netty/example/http2/server/Http2ServerInitializer.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/example/src/main/java/io/netty/example/http2/client/Http2ClientInitializer.java b/example/src/main/java/io/netty/example/http2/client/Http2ClientInitializer.java index 3fff0c0d89..f801e55715 100644 --- a/example/src/main/java/io/netty/example/http2/client/Http2ClientInitializer.java +++ b/example/src/main/java/io/netty/example/http2/client/Http2ClientInitializer.java @@ -38,7 +38,7 @@ public class Http2ClientInitializer extends ChannelInitializer { ChannelPipeline pipeline = ch.pipeline(); pipeline.addLast("http2FrameCodec", new Http2FrameCodec()); - pipeline.addLast("spdyFrameLogger", new Http2FrameLogger(INFO)); + pipeline.addLast("http2FrameLogger", new Http2FrameLogger(INFO)); pipeline.addLast("http2ConnectionHandler", new Http2ConnectionHandler(false)); pipeline.addLast("httpHandler", httpResponseHandler); } diff --git a/example/src/main/java/io/netty/example/http2/server/Http2ServerInitializer.java b/example/src/main/java/io/netty/example/http2/server/Http2ServerInitializer.java index aca941973c..460d8dce9e 100644 --- a/example/src/main/java/io/netty/example/http2/server/Http2ServerInitializer.java +++ b/example/src/main/java/io/netty/example/http2/server/Http2ServerInitializer.java @@ -16,9 +16,11 @@ package io.netty.example.http2.server; +import static io.netty.util.internal.logging.InternalLogLevel.INFO; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelPipeline; import io.netty.channel.socket.SocketChannel; +import io.netty.example.http2.client.Http2FrameLogger; import io.netty.handler.codec.http2.draft10.connection.Http2ConnectionHandler; import io.netty.handler.codec.http2.draft10.frame.Http2FrameCodec; @@ -31,6 +33,7 @@ public class Http2ServerInitializer extends ChannelInitializer { ChannelPipeline p = ch.pipeline(); p.addLast("http2FrameCodec", new Http2FrameCodec()); + p.addLast("http2FrameLogger", new Http2FrameLogger(INFO)); p.addLast("http2ConnectionHandler", new Http2ConnectionHandler(true)); p.addLast("helloWorldHandler", new HelloWorldHandler()); }