Skip to content

Commit 16b0c9c

Browse files
committed
Removing SDK loggers and using Netty logging handlers
1 parent 6e1c381 commit 16b0c9c

File tree

4 files changed

+11
-333
lines changed

4 files changed

+11
-333
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"category": "Netty NIO HTTP Client",
3+
"type": "feature",
4+
"description": "Allows customers to enable wire logging with the Netty client at debug level."
5+
}

http-clients/netty-nio-client/src/main/java/software/amazon/awssdk/http/nio/netty/internal/ChannelPipelineInitializer.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@
2828
import io.netty.channel.pool.ChannelPool;
2929
import io.netty.handler.codec.http.HttpClientCodec;
3030
import io.netty.handler.codec.http2.ForkedHttp2MultiplexCodecBuilder;
31+
import io.netty.handler.codec.http2.Http2FrameLogger;
3132
import io.netty.handler.codec.http2.Http2Settings;
3233
import io.netty.handler.codec.http2.Http2SettingsFrame;
34+
import io.netty.handler.logging.LogLevel;
35+
import io.netty.handler.logging.LoggingHandler;
3336
import io.netty.handler.ssl.SslContext;
3437
import java.io.IOException;
3538
import java.util.Optional;
@@ -38,7 +41,6 @@
3841
import software.amazon.awssdk.annotations.SdkInternalApi;
3942
import software.amazon.awssdk.http.Protocol;
4043
import software.amazon.awssdk.http.nio.netty.internal.http2.MultiplexedChannelRecord;
41-
import software.amazon.awssdk.http.nio.netty.internal.http2.SdkHttp2FrameLogger;
4244

4345
/**
4446
* Configures the client pipeline to support HTTP/2 frames with multiplexed streams.
@@ -77,15 +79,16 @@ public void channelCreated(Channel ch) {
7779

7880
pipeline.addLast(new FutureCancelHandler());
7981
pipeline.addLast(new UnusedChannelExceptionHandler());
82+
pipeline.addLast(new LoggingHandler(LogLevel.DEBUG));
8083
}
8184

8285
private void configureHttp2(Channel ch, ChannelPipeline pipeline) {
8386
ForkedHttp2MultiplexCodecBuilder codecBuilder = ForkedHttp2MultiplexCodecBuilder
8487
.forClient(new NoOpChannelInitializer())
8588
.headerSensitivityDetector((name, value) -> lowerCase(name.toString()).equals("authorization"))
8689
.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));
8992

9093
pipeline.addLast(codecBuilder.build());
9194

http-clients/netty-nio-client/src/main/java/software/amazon/awssdk/http/nio/netty/internal/http2/SdkHttp2FrameLogger.java

Lines changed: 0 additions & 161 deletions
This file was deleted.

http-clients/netty-nio-client/src/main/java/software/amazon/awssdk/http/nio/netty/internal/utils/LoggingHandler.java

Lines changed: 0 additions & 169 deletions
This file was deleted.

0 commit comments

Comments
 (0)