API 요청시 로그 추가
This commit is contained in:
@@ -17,6 +17,7 @@ public class ApiClientFactory {
|
||||
public ApiClient getClient(ApiRequestDTO request) {
|
||||
switch (request.getType().toUpperCase()) {
|
||||
case "HTTP":
|
||||
case "HTTPFLAT":
|
||||
return httpApiClient;
|
||||
case "TCP":
|
||||
return tcpApiClient;
|
||||
|
||||
@@ -72,6 +72,7 @@ public class NettyHttpApiClient implements ApiClient {
|
||||
ch.pipeline().addLast(new HttpClientCodec());
|
||||
ch.pipeline().addLast(new HttpObjectAggregator(65536));
|
||||
ch.pipeline().addLast(new HttpContentDecompressor());
|
||||
ch.pipeline().addLast(new HttpRequestLoggerHandler()); // Add custom HttpRequestLoggerHandler
|
||||
ch.pipeline().addLast(new HttpHandler(responseFuture));
|
||||
}
|
||||
});
|
||||
@@ -92,8 +93,7 @@ public class NettyHttpApiClient implements ApiClient {
|
||||
if (queryIndex != -1) {
|
||||
String path = fullPath.substring(0, queryIndex);
|
||||
String queryParams = fullPath.substring(queryIndex + 1);
|
||||
String encodedQueryParams = URLEncoder.encode(queryParams);
|
||||
encodedPath = path + "?" + encodedQueryParams;
|
||||
encodedPath = path + "?" + queryParams;
|
||||
}
|
||||
|
||||
HttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.valueOf(apiRequest.getMethod()), encodedPath, content);
|
||||
|
||||
Reference in New Issue
Block a user