-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an example with dependency logs #46
Comments
Hi @remyleone 👋 Thank you for raising this and we'd love to dig deeper into this so it can be appropriately documented. Can you elaborate a little more on your situation, for example, does the Go module implement the equivalent of the |
I would like to use the logging coming from our sdk go that is available at the following address: https://github.com/scaleway/scaleway-sdk-go/blob/master/logger/logger.go I'm not sure about how to transmit the ctx required in the tflog methods. |
Documentation would be extra helpful because I've tried to show up a hello world message using |
Taking a brief look at the existing scaleway SDK logger, I think translating it, or really any other external logger, into something terraform-plugin-log can correctly use might be non-trivial. Implementing something like
Does the situation improve if you upgrade the provider to If not, that is probably a bug worth raising in terraform-plugin-sdk to make it more noisy when it cannot automatically setup the root provider logger correctly. 👍 |
@bflad I've updated terraform-plugin-sdk to the v2.11.0 and I still do not observe any change. When I do:
The log message does not show up. But when I do
It does show up. So I think there is an issue there. |
When running a Terraform Provider in "production", all provider logging is through Terraform CLI, so therefore Terraform CLI's logging mechanisms must be enabled for provider logging to be output. In effect, this means that When running a Terraform Provider during acceptance testing, logging is directly handled by the provider binary and the SDKs, however there is code that partially emulates the environment variable behavior of Terraform CLI to prevent provider logging from unexpectedly flooding the It may be possible to force all loggers to default to discarding so the root loggers can always be enabled (rather than the current design preference of the opposite), but then each logger will be responsible for checking every "parent" logger levels to determine what level it should output. Not necessarily difficult, but not trivial either. |
Does this documenation exist?
Where would you expect to find this documentation?
Details
Sometimes you have logs that are created in a dependency of the provider and not directly in the provider per see. How can we forward some SDK logs that contain valuable information to the tflog package?
Description
References
The text was updated successfully, but these errors were encountered: