Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

buzztroll
Copy link
Contributor

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.

@apparentlymart apparentlymart changed the title Log message bogy for ARM API calls Log message body for ARM API calls May 3, 2016
@jen20
Copy link
Contributor

jen20 commented May 3, 2016

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.

@jen20
Copy link
Contributor

jen20 commented May 3, 2016

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.

@buzztroll
Copy link
Contributor Author

@jen20 makes sense. I'll change it to trace.

@jen20
Copy link
Contributor

jen20 commented May 3, 2016

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.
@buzztroll
Copy link
Contributor Author

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?

@jen20
Copy link
Contributor

jen20 commented May 4, 2016

@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.

@stack72
Copy link
Contributor

stack72 commented Aug 15, 2016

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

@stack72 stack72 added the waiting-response An issue/pull request is waiting for a response from the community label Aug 15, 2016
@buzztroll
Copy link
Contributor Author

It is fine to close this one but I would great if you could take another look at #6429 :-)

@buzztroll buzztroll closed this Aug 15, 2016
@ghost
Copy link

ghost commented Apr 23, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement provider/azurerm waiting-response An issue/pull request is waiting for a response from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants