Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How do I view or collect SqlClient Traces on Azure? #2169

Trivedi-Ashish started this conversation in General
Discussion options

How do I enable and view SqlClient traces if I have a web app hosted on Azure and it uses SqlClient. I know that we can use XPerf/PerfView to collect and view traces. But I am not sure how to use it when the web app is hosted on Azure app service.

You must be logged in to vote

Replies: 1 comment 3 replies

Comment options

Create your own listener in your app:
https://learn.microsoft.com/en-us/sql/connect/ado-net/enable-eventsource-tracing?view=sql-server-ver16#example

In OnEventWritten, you can log to your app service logs.

You must be logged in to vote
3 replies
Comment options

I have a NuGet package that might be able to help you; https://www.nuget.org/packages/ErikEJ.SqlClient.Extensions

Comment options

@David-Engel Are SQL Server drivers integrated with Microsoft.Extensions.Logging?
(https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging?view=dotnet-plat-ext-7.0)

Comment options

@pfdsilva no, but my project shows a possible way to do just that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /