Search code examples
c#event-logazure-diagnostics

What's valid as an event log data source?


I've been fiddling with Azure Diagnostics of late, and although the purpose of the following line of code is reasonably clear, the set of valid values that I can use in place of Application!* isn't (taken from here).

diagnosticConfiguration.WindowsEventLog.DataSources.Add("Application!*");

What's the syntax for that string, and specifically... what does the exclamation mark mean?! :)


Solution

  • This is the standard Windows Event Log query. You can get more information here. And some explanation about Azure diagnostics in particular here.

    In summary - Application!* will get all entries in the Application event log. But you can limit this by being more specific - for example if you would like events from only particular source, or event event type.