Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
1.99k stars 1.16k forks source link

A way to log unredacted HTTP request/response headers and request/response body #30190

Open dargilco opened 3 weeks ago

dargilco commented 3 weeks ago

JS Logger only allows you to log redacted HTTP request/response headers. It does not allow you to log the full request/response body. I develop Azure SDKs in several programming languages. In C# and Python we have an easy way to create a logger and configure it to do unredacted log of HTTP request/response, and log full request/response text body (e.g. JSONs). I turn on this kind of logging very often, and it saved my hours of development time diagnosing client SDK and service issues. Please enable the same thing on the JS logger. Thanks!

jeremymeng commented 1 week ago

python has a separate logging policy that is opt-in and only works on the DEBUG logging level https://github.com/Azure/azure-sdk-for-python/blob/10673391ceefe5c6ef386a08c8968d5f7ce4b173/sdk/core/azure-core/azure/core/pipeline/policies/_universal.py#L265