|
28 | 28 | import io.netty.channel.pool.ChannelPool;
|
29 | 29 | import io.netty.handler.codec.http.HttpClientCodec;
|
30 | 30 | import io.netty.handler.codec.http2.ForkedHttp2MultiplexCodecBuilder;
|
| 31 | +import io.netty.handler.codec.http2.Http2FrameLogger; |
31 | 32 | import io.netty.handler.codec.http2.Http2Settings;
|
32 | 33 | import io.netty.handler.codec.http2.Http2SettingsFrame;
|
| 34 | +import io.netty.handler.logging.LogLevel; |
| 35 | +import io.netty.handler.logging.LoggingHandler; |
33 | 36 | import io.netty.handler.ssl.SslContext;
|
34 | 37 | import java.io.IOException;
|
35 | 38 | import java.util.Optional;
|
|
38 | 41 | import software.amazon.awssdk.annotations.SdkInternalApi;
|
39 | 42 | import software.amazon.awssdk.http.Protocol;
|
40 | 43 | import software.amazon.awssdk.http.nio.netty.internal.http2.MultiplexedChannelRecord;
|
41 |
| -import software.amazon.awssdk.http.nio.netty.internal.http2.SdkHttp2FrameLogger; |
42 | 44 |
|
43 | 45 | /**
|
44 | 46 | * Configures the client pipeline to support HTTP/2 frames with multiplexed streams.
|
@@ -77,15 +79,16 @@ public void channelCreated(Channel ch) {
|
77 | 79 |
|
78 | 80 | pipeline.addLast(new FutureCancelHandler());
|
79 | 81 | pipeline.addLast(new UnusedChannelExceptionHandler());
|
| 82 | + pipeline.addLast(new LoggingHandler(LogLevel.DEBUG)); |
80 | 83 | }
|
81 | 84 |
|
82 | 85 | private void configureHttp2(Channel ch, ChannelPipeline pipeline) {
|
83 | 86 | ForkedHttp2MultiplexCodecBuilder codecBuilder = ForkedHttp2MultiplexCodecBuilder
|
84 | 87 | .forClient(new NoOpChannelInitializer())
|
85 | 88 | .headerSensitivityDetector((name, value) -> lowerCase(name.toString()).equals("authorization"))
|
86 | 89 | .initialSettings(Http2Settings.defaultSettings().initialWindowSize(1_048_576));
|
87 |
| - // If frame logging is enabled, add it |
88 |
| - SdkHttp2FrameLogger.frameLogger().ifPresent(codecBuilder::frameLogger); |
| 90 | + |
| 91 | + codecBuilder.frameLogger(new Http2FrameLogger(LogLevel.DEBUG)); |
89 | 92 |
|
90 | 93 | pipeline.addLast(codecBuilder.build());
|
91 | 94 |
|
|
0 commit comments