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.
This commit is contained in:
parent
a992e7fb48
commit
9496c1a4ed
@ -38,7 +38,7 @@ public class Http2ClientInitializer extends ChannelInitializer<SocketChannel> {
|
|||||||
ChannelPipeline pipeline = ch.pipeline();
|
ChannelPipeline pipeline = ch.pipeline();
|
||||||
|
|
||||||
pipeline.addLast("http2FrameCodec", new Http2FrameCodec());
|
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("http2ConnectionHandler", new Http2ConnectionHandler(false));
|
||||||
pipeline.addLast("httpHandler", httpResponseHandler);
|
pipeline.addLast("httpHandler", httpResponseHandler);
|
||||||
}
|
}
|
||||||
|
@ -16,9 +16,11 @@
|
|||||||
|
|
||||||
package io.netty.example.http2.server;
|
package io.netty.example.http2.server;
|
||||||
|
|
||||||
|
import static io.netty.util.internal.logging.InternalLogLevel.INFO;
|
||||||
import io.netty.channel.ChannelInitializer;
|
import io.netty.channel.ChannelInitializer;
|
||||||
import io.netty.channel.ChannelPipeline;
|
import io.netty.channel.ChannelPipeline;
|
||||||
import io.netty.channel.socket.SocketChannel;
|
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.connection.Http2ConnectionHandler;
|
||||||
import io.netty.handler.codec.http2.draft10.frame.Http2FrameCodec;
|
import io.netty.handler.codec.http2.draft10.frame.Http2FrameCodec;
|
||||||
|
|
||||||
@ -31,6 +33,7 @@ public class Http2ServerInitializer extends ChannelInitializer<SocketChannel> {
|
|||||||
ChannelPipeline p = ch.pipeline();
|
ChannelPipeline p = ch.pipeline();
|
||||||
|
|
||||||
p.addLast("http2FrameCodec", new Http2FrameCodec());
|
p.addLast("http2FrameCodec", new Http2FrameCodec());
|
||||||
|
p.addLast("http2FrameLogger", new Http2FrameLogger(INFO));
|
||||||
p.addLast("http2ConnectionHandler", new Http2ConnectionHandler(true));
|
p.addLast("http2ConnectionHandler", new Http2ConnectionHandler(true));
|
||||||
p.addLast("helloWorldHandler", new HelloWorldHandler());
|
p.addLast("helloWorldHandler", new HelloWorldHandler());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user