CosX
CosX

Reputation: 2030

Is it possible to log windows events to application insights?

We're running Application Insights on some of our sites and we want to aggregate logs from the windows event log. We are running on windows server 2016.

I know that other log-shippers like elastic has the possibility to send logs from the windows event log. Is it possible from Application Insights?

Edit 22.10.2018

After @cijothomas's comment I tried adding the EtwCollector nuget package from Microsoft and added a few providers to the config.

<Add ProviderName="Microsoft-Windows-Crashdump" Level="Warning"/>
<Add ProviderName=".NET Common Language Runtime" Level="Warning" />
<Add ProviderName="ASP.NET Events" Level="Warning" />
<Add ProviderName="Microsoft-Windows-IIS-IISReset" Level="Warning" />
<Add ProviderName="Microsoft-Windows-HttpLog" Level="Warning" />

In Application Insights, I now get a trace from the application.

AI: Failed to enable provider for the EtwTelemetryModule. Access Denied.

and for example for the Microsoft-Windows-IIS-IISReset provider.

AI: Failed to enable provider Microsoft-Windows-IIS-IISReset for the EtwTelemetryModule.

I've added the applications user process to the "Performance Log Users" group in windows. Is it any other setting that I need to add to allow the logs to be shipped from this provider?

Upvotes: 2

Views: 2073

Answers (1)

cijothomas
cijothomas

Reputation: 3126

Did you mean ETW events? if yes, then Application Insights has an adapter to send ETW events as Application Insights Traces. https://learn.microsoft.com/en-us/azure/application-insights/app-insights-asp-net-trace-logs#using-etw-events

Alternately, you can always do manual TrackTrace() method to send any traces to Application Insights. https://learn.microsoft.com/en-us/azure/application-insights/app-insights-api-custom-events-metrics#tracktrace

Upvotes: 3

Related Questions