The following example writes real time performance data to a log file. The example calls the PdhOpenQuery and PdhAddCounter functions to create a query to collect Processor Time counter data. The example then calls the PdhOpenLog function to create the log file to write the data to. The example calls the PdhUpdateLog function to collect a sample and update the log file once a second for 20 seconds.
Write log queries to gain insights into your business, IT operations, and performance. Use Kusto Query Language (KQL) to extract log data in Azure Monitor Log Analytics.