diff --git a/.changelog/315.txt b/.changelog/315.txt new file mode 100644 index 000000000..477e0ce96 --- /dev/null +++ b/.changelog/315.txt @@ -0,0 +1,7 @@ +```release-note:bug +tfsdk: Prevented `Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options` warning logs during acceptance testing +``` + +```release-note:enhancement +tfsdk: Propagated `tf_data_source_type`, `tf_req_id`, `tf_resource_type`, and `tf_rpc` fields in log entries +``` diff --git a/go.mod b/go.mod index 8b78f8a4a..b00f04cb4 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.17 require ( github.com/google/go-cmp v0.5.8 github.com/hashicorp/terraform-plugin-go v0.9.0 - github.com/hashicorp/terraform-plugin-log v0.3.0 + github.com/hashicorp/terraform-plugin-log v0.4.0 ) require ( diff --git a/go.sum b/go.sum index d8539961b..f1b2cbd38 100644 --- a/go.sum +++ b/go.sum @@ -65,8 +65,9 @@ github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/terraform-plugin-go v0.9.0 h1:FvLY/3z4SNVatPZdoFcyrlNbCar+WyyOTv5X4Tp+WZc= github.com/hashicorp/terraform-plugin-go v0.9.0/go.mod h1:EawBkgjBWNf7jiKnVoyDyF39OSV+u6KUX+Y73EPj3oM= -github.com/hashicorp/terraform-plugin-log v0.3.0 h1:NPENNOjaJSVX0f7JJTl4f/2JKRPQ7S2ZN9B4NSqq5kA= github.com/hashicorp/terraform-plugin-log v0.3.0/go.mod h1:EjueSP/HjlyFAsDqt+okpCPjkT4NDynAe32AeDC4vps= +github.com/hashicorp/terraform-plugin-log v0.4.0 h1:F3eVnm8r2EfQCe2k9blPIiF/r2TT01SHijXnS7bujvc= +github.com/hashicorp/terraform-plugin-log v0.4.0/go.mod h1:9KclxdunFownr4pIm1jdmwKRmE4d6HVG2c9XDq47rpg= github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896 h1:1FGtlkJw87UsTMg5s8jrekrHmUPUJaMcu6ELiVhQrNw= github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896/go.mod h1:bzBPnUIkI0RxauU8Dqo+2KrZZ28Cf48s8V6IHt3p4co= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= diff --git a/internal/logging/context.go b/internal/logging/context.go index 315f83c45..8f286cd67 100644 --- a/internal/logging/context.go +++ b/internal/logging/context.go @@ -14,6 +14,8 @@ func InitContext(ctx context.Context) context.Context { // All calls are through the Framework* helper functions tfsdklog.WithAdditionalLocationOffset(1), tfsdklog.WithLevelFromEnv(EnvTfLogSdkFramework), + // Propagate tf_req_id, tf_rpc, etc. fields + tfsdklog.WithRootFields(), ) return ctx