

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# AWS SDK for Ruby 클라이언트의 유선 추적 정보를 사용하여 디버깅
<a name="debugging"></a>

`http_wire_trace` 부울을 설정하여 AWS 클라이언트에서 유선 추적 정보를 가져올 수 있습니다. 와이어 트레이스 정보는 클라이언트 변경 사항, 서비스 문제, 사용자 오류를 구분하는 데 도움이 됩니다. `true`인 경우 설정에 와이어로 전송되는 내용이 표시됩니다. 다음 예제에서는 클라이언트 생성 시에 와이어 트레이싱을 사용하는 Amazon S3 클라이언트를 생성합니다.

```
s3 = Aws::S3::Client.new(http_wire_trace: true)
```

다음 코드와 인수 `bucket_name`에 따라 출력에 해당 이름의 버킷이 있는지 여부를 알려 주는 메시지가 표시됩니다.

```
require 'aws-sdk-s3'

s3 = Aws::S3::Resource.new(client: Aws::S3::Client.new(http_wire_trace: true))

if s3.bucket(ARGV[0]).exists?
  puts "Bucket #{ARGV[0]} exists"
else
  puts "Bucket #{ARGV[0]} does not exist"
end
```

버킷이 있는 경우 출력은 다음과 비슷합니다. (가독성을 높이기 위해 `HEAD` 줄에 반환이 추가되었습니다.)

```
opening connection to bucket_name.s3-us-west-1.amazonaws.com:443...
opened
starting SSL for bucket_name.s3-us-west-1.amazonaws.com:443...
SSL established, protocol: TLSv1.2, cipher: ECDHE-RSA-AES128-GCM-SHA256
-> "HEAD / HTTP/1.1
    Accept-Encoding: 
    User-Agent: aws-sdk-ruby3/3.171.0 ruby/3.2.2 x86_64-linux aws-sdk-s3/1.120.0
    Host: bucket_name.s3-us-west-1.amazonaws.com
    X-Amz-Date: 20230427T143146Z
/* omitted */
Accept: */*\r\n\r\n"
-> "HTTP/1.1 200 OK\r\n"
-> "x-amz-id-2: XxB2J+kpHgTjmMUwpkUI1EjaFSPxAjWRgkn/+z7YwWc/iAX5E3OXRBzJ37cfc8T4D7ELC1KFELM=\r\n"
-> "x-amz-request-id: 5MD4APQQS815QVBR\r\n"
-> "Date: Thu, 27 Apr 2023 14:31:47 GMT\r\n"
-> "x-amz-bucket-region: us-east-1\r\n"
-> "x-amz-access-point-alias: false\r\n"
-> "Content-Type: application/xml\r\n"
-> "Server: AmazonS3\r\n"
-> "\r\n"
Conn keep-alive
Bucket bucket_name exists
```

클라이언트 생성 후 와이어 트레이싱을 켤 수도 있습니다.

```
s3 = Aws::S3::Client.new
s3.config.http_wire_trace = true
```

보고된 와이어 트레이스 정보의 필드에 대한 자세한 내용은 [Transfer Family required request headers](https://docs.aws.amazon.com/transfer/latest/userguide/making-api-requests.html#request-headers)를 참조하세요.