Skip to content

Commit

Permalink
Streamline the links at the end of the website doc for HTTP Transport
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan De Marino committed Jul 28, 2022
1 parent a54afb1 commit afe1761
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions website/docs/plugin/sdkv2/logging/http-transport.mdx
Expand Up @@ -162,18 +162,18 @@ the following example shows the same logs in JSON format.

Each log contains the following information, which is represented as [fields](https://www.terraform.io/plugin/log/writing#fields) in the JSON format.

| Log field name | Description | Possible values | Applies to |
|---------------------------:|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|:------------------:|
| `tf_http_op_type` | Which HTTP operation log refers to | [`request`, `response`] | Request / Response |
| `tf_http_trans_id` | Unique identifier used by Request and Response that belong to the same HTTP Transaction | A universally unique identifier ([UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)) | Request / Response |
| `tf_http_req_body` | Request body | | Request |
| `tf_http_req_method` | Request method | A canonical [HTTP methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method) | Request |
| `tf_http_req_uri` | Request URI | Ex. `"/path"` | Request |
| `tf_http_req_version` | Request HTTP version | Ex. `"HTTP/1.1"` | Request |
| `tf_http_res_body` | Response body | | Response |
| `tf_http_res_status_code` | Response status code | A canonical [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) | Response |
| `tf_http_res_status_reason | Response status reason | Canonical textual description of the corresponding `tf_http_res_status_code` | Response |
| `tf_http_res_version` | Response HTTP version | Ex. `"HTTP/2.0"` | Response |
| Log field name | Description | Possible values | Applies to |
|---------------------------:|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|:------------------:|
| `tf_http_op_type` | Which HTTP operation log refers to | [`request`, `response`] | Request / Response |
| `tf_http_trans_id` | Unique identifier used by Request and Response that belong to the same HTTP Transaction | A universally unique identifier ([UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)) | Request / Response |
| `tf_http_req_body` | Request body | | Request |
| `tf_http_req_method` | Request method | A canonical [HTTP methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method) | Request |
| `tf_http_req_uri` | Request URI | Ex. `"/path"` | Request |
| `tf_http_req_version` | Request HTTP version | Ex. `"HTTP/1.1"` | Request |
| `tf_http_res_body` | Response body | | Response |
| `tf_http_res_status_code` | Response status code | A canonical [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) | Response |
| `tf_http_res_status_reason | Response status reason | Canonical textual description of the corresponding `tf_http_res_status_code` | Response |
| `tf_http_res_version` | Response HTTP version | Ex. `"HTTP/2.0"` | Response |
| (Other fields) | Request / Response headers. One field per header. If the header contains a single value, the log field value is set to that value. Otherwise, the field value is a slice of strings. | | Request / Response |
Expand Down Expand Up @@ -201,11 +201,8 @@ defer res.Body.Close()
```


# Resources
# Links

* [Plugin Development](https://www.terraform.io/plugin)
* [Plugin Development - Logging](https://www.terraform.io/plugin/log)
* [terraform-plugin-log - tflog](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-log/tflog) package documentation
* [terraform-plugin-log](https://github.com/hashicorp/terraform-plugin-log) GitHub repository
* [terraform-plugin-sdk](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2) [`NewLoggingHTTPTransport()`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging#NewLoggingHTTPTransport) and [`NewSubsystemLoggingHTTPTransport()`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging#NewSubsystemLoggingHTTPTransport)
* [New Logging Transport](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/helper/logging/logging_http_transport.go) source code
* [Plugin Development - Logging](https://www.terraform.io/plugin/log) - Learn more about the logging framework
* [terraform-plugin-log - tflog](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-log/tflog) - Read the Golang documentation for the logging framework
* Read the Golang documentation for [`NewLoggingHTTPTransport()`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging#NewLoggingHTTPTransport) and [`NewSubsystemLoggingHTTPTransport()`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging#NewSubsystemLoggingHTTPTransport)

0 comments on commit afe1761

Please sign in to comment.