Merge pull request #30048 from hashicorp/kmoe/http-backend-debug-log

backend/http: supply logging.LogOutput() to retryable client
This commit is contained in:
kmoe 2021-11-30 14:25:28 +00:00 committed by GitHub
commit 8f923cea08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import (
"context"
"crypto/tls"
"fmt"
"log"
"net/http"
"net/url"
"time"
@ -12,6 +13,7 @@ import (
"github.com/hashicorp/go-retryablehttp"
"github.com/hashicorp/terraform/internal/backend"
"github.com/hashicorp/terraform/internal/legacy/helper/schema"
"github.com/hashicorp/terraform/internal/logging"
"github.com/hashicorp/terraform/internal/states/remote"
"github.com/hashicorp/terraform/internal/states/statemgr"
)
@ -161,6 +163,7 @@ func (b *Backend) configure(ctx context.Context) error {
rClient.RetryMax = data.Get("retry_max").(int)
rClient.RetryWaitMin = time.Duration(data.Get("retry_wait_min").(int)) * time.Second
rClient.RetryWaitMax = time.Duration(data.Get("retry_wait_max").(int)) * time.Second
rClient.Logger = log.New(logging.LogOutput(), "", log.Flags())
b.client = &httpClient{
URL: updateURL,