diff --git a/README.md b/README.md index 2fd69b3f4..e6f18c501 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ The `go-pagerduty` library relies on various APIs to interact with PagerDuty's r ### To activate caching support | Environment Variable | Example Value | Description | -| -------------------------- | ---------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +|----------------------------|------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------| | TF_PAGERDUTY_CACHE | memory | Activate **In Memory** cache. | | TF_PAGERDUTY_CACHE | `mongodb+srv://[mongouser]:[mongopass]@[mongodbname].[mongosubdomain].mongodb.net` | Activate MongoDB cache. | | TF_PAGERDUTY_CACHE_MAX_AGE | 30s | Only applicable for MongoDB cache. Time in seconds for cached data to become staled. Default value `10s`. | @@ -144,6 +144,24 @@ $ go mod vendor $ tail -f /PATH/TO/YOUR/LOG_FILE.log ``` +### Secure Logs Level + +In addition to the [log levels provided by Terraform](https://developer.hashicorp.com/terraform/internals/debugging), namely `TRACE`, `DEBUG`, `INFO`, `WARN`, and `ERROR` (in descending order of verbosity), the PagerDuty Provider introduces an extra level called `SECURE`. This level offers verbosity similar to Terraform's debug logging level, specifically for the output of API calls and HTTP request/response logs. The key difference is that API keys within the request's Authorization header will be obfuscated, revealing only the last four characters. An example is provided below: + +```sh +---[ REQUEST ]--------------------------------------- +GET /teams/DER8RFS HTTP/1.1 +Accept: application/vnd.pagerduty+json;version=2 +Authorization: kCjQ +Content-Type: application/json +User-Agent: (darwin arm64) Terraform/1.5.1 +``` + +To enable the `SECURE` log level, you must set two environment variables: + +* `TF_LOG=INFO` +* `TF_LOG_PROVIDER_PAGERDUTY=SECURE` + ## Testing In order to test the provider, you can simply run `make test`.