Inline C# script that collects ETW and stores it in a text file
ETW stands for Event Tracing for Windows. It's a powerful and built-in tracing mechanism within the Windows operating system that allows developers and system administrators to capture detailed information about the behavior of applications, the system itself, and even kernel-mode drivers.
Usually we can use the Logman tool to collect the ETW , but this tool is not allowed to be used in logic app kudo , so the solution was to come up with a code base solution
How to collect the EWT using C# ?
I have built in previous article a small tool that collect the ETW from Http operation , the whole idea is to implement a class of type EventListener
How this tool works
download the ETW collector flow and the C# file from Github
in the compose action modify the URL to your test case url where you are calling http endpoint or sftp or SMTP etc.
then run the collector flow ,
after the flow is finished you need to open Kudo and in the log folder to will find the log file
What the C# do
it will create the ETW listener and then call the child logic app which is the logic app that we will test ,
I have some event that I am ignoring , the because they are very nosey and some of them will make Stack over flow error like System.Data.DataCommonEventSource
private readonly Hashtable ignoredList = new Hashtable
{
{ "Private.InternalDiagnostics.System.Net.Http_decrypt", null },
{ "System.Data.DataCommonEventSource_Trace", null },
{ "System.Buffers.ArrayPoolEventSource", null },
{ "System.Threading.Tasks.TplEventSource", null },
{ "Microsoft-ApplicationInsights-Data", null }
};
then putting all the logs in Data table and finally convert this data table to text file
How to open the log file?
I do recommend to use something like Klogg variar/klogg
or normal VS code.
Updated Feb 12, 2025
Version 1.0Mohammed_Barqawi
Microsoft
Joined May 14, 2020
Azure Integration Services Blog
Follow this blog board to get notified when there's new activity