-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Log message body for ARM API calls #6445
Conversation
Hi @buzztroll! This LGTM - but note we are using two different Azure clients (the official one and my own Riviera), so this will not currently apply to all resources. During development we have been using Charles to proxy traffic to Azure, which may be a useful trick. |
On second thoughts it might be better to log at the TRACE level and not be conditional on an environment variable - this would match the AWS provider. |
@jen20 makes sense. I'll change it to trace. |
Thanks @buzztroll! I'll try to ensure this gets into 0.6.16 as it has definite debugging benefits. |
This PR adds a decorator to the to the Sender object so that the payload of the REST calls can be logged. In order to enable this the environment variable must be set AZURERM_LOG_BODY.
From what I can tell it seems that the intent of logging in the providers is to have all logs at the debug level and prepend the provider name before it. Can you help me figure out how to switch this to TRACE? |
@buzztroll We can use a pattern similar to that used in the AWS provider: https://github.com/hashicorp/terraform/blob/master/builtin/providers/aws/config.go#L155-L158. I'll look at doing this before the next release. |
Hi @buzztroll Is this still needed? I didn't realise this PR was here and merged something else that does a similar thing https://github.com/hashicorp/terraform/blob/master/builtin/providers/azurerm/config.go#L71 Paul |
It is fine to close this one but I would great if you could take another look at #6429 :-) |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
This PR adds a decorator to the to the Sender object so that the payload
of the REST calls can be logged. In order to enable this the environment
variable must be set AZURERM_LOG_BODY.