kiota icon indicating copy to clipboard operation
kiota copied to clipboard

Logging in Kiota

Open nikithauc opened this issue 4 years ago • 5 comments

AB#11127

nikithauc avatar Sep 13 '21 23:09 nikithauc

Thanks for logging this one. This is something I had put on ice for a while. I believe that only the core implementations (serialization, http, auth) need to log things. I don't believe the generated result needs to log anything itself per se. But I'm open to perspectives on this one. And I'd also like @darrelmiller input.

We could also provide a logging middleware with the default http core implementation. But it feels like giving people a gun to shoot themselves in the foot with. This could easily lead to logged tokens, or personal information, logs which could be compromised as we've seen in the past.

I do think we should seriously consider open telemetry

baywet avatar Sep 14 '21 12:09 baywet

Yes https://opentelemetry.io/ is what we should be looking at. We should also follow the Azure SDK logging policies https://azure.github.io/azure-sdk/general_azurecore.html#logging-policy unless we have good reason not to.

Ideally we want people to be able to reuse this OpenTelemetry exporter for Azure Monitor https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/README.md

darrelmiller avatar Nov 30 '21 13:11 darrelmiller

Thanks for this additional precision. Where would you have logging implemented? Abstractions? http? auth? serialization? all of them? I don't think the logging should be added to what we generate, but only in the "handcrafted" code.

baywet avatar Nov 30 '21 13:11 baywet

I don't think the logging should be added to what we generate, but only in the "handcrafted" code. Agreed.

Abstractions - I don't think so. Http - definitely Auth - definitely Serialization - maybe.

darrelmiller avatar Nov 30 '21 14:11 darrelmiller

Work item for Java: https://github.com/microsoft/kiota-java/issues/33

maisarissi avatar May 27 '22 15:05 maisarissi

spec in progress https://github.com/microsoftgraph/msgraph-sdk-design/pull/72

baywet avatar Sep 09 '22 16:09 baywet