-
Notifications
You must be signed in to change notification settings - Fork 330
How do I view or collect SqlClient Traces on Azure? #2169
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 3 replies
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
I have a NuGet package that might be able to help you; https://www.nuget.org/packages/ErikEJ.SqlClient.Extensions
Beta Was this translation helpful? Give feedback.
All reactions
-
@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)
Beta Was this translation helpful? Give feedback.
All reactions
-
@pfdsilva no, but my project shows a possible way to do just that
Beta Was this translation helpful? Give feedback.