diff --git a/website/docs/plugin/log/writing.mdx b/website/docs/plugin/log/writing.mdx index bea3874..b0f2e1f 100644 --- a/website/docs/plugin/log/writing.mdx +++ b/website/docs/plugin/log/writing.mdx @@ -21,10 +21,10 @@ One of the following SDK versions is required to properly output structured logs - [`terraform-plugin-framework`](/terraform/plugin/framework) version 0.6.0 or later - [`terraform-plugin-sdk`](/terraform/plugin/sdkv2) version 2.10.0 or later -Follow the [legacy logging](#legacy-logging) instructions to write logs with older versions. - All calls to `tflog` package functionality must use an SDK provided `context.Context`, which stores the logging implementation. Every `terraform-plugin-framework` method implemented by providers automatically includes the correct `context.Context`. Providers written with `terraform-plugin-sdk` must use context-aware functionality, such as the [`helper/schema.Resource` type `ReadContext` field](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema#Resource.ReadContext). +Follow the [legacy logging](#legacy-logging) instructions to write logs with older SDK versions or when context-aware functionality is not available, for instance [SchemaStateFunc](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/helper/schema#SchemaStateFunc). + ### Log Levels You must choose a verbosity level for each line of log output. This lets consumers [specify a type of log output](/terraform/plugin/log/managing#log-levels) to write from your provider. For example, you can use environment fields to set your provider to write only logs of type `Warn` during a Terraform run.