Skip to content

LogMonitor with named provider without GUID? #66

@mloskot

Description

@mloskot

This is a feature request to allow access to log equivalent to this

Get-WinEvent -ProviderName "My.Custom.Service.1.2.3"

I have a custom Windows service and I can use that PowerShell cmdlet to access the logs.

However, if I feed the LogMonitor with the following bit in my LogMonitorConfig.json:

{
  "type": "ETW",
  "eventFormatMultiLine": false,
  "providers": [
    {
      "providerName": "My.Custom.Service.1.2.3",
      "level": "Information"
    }
  ]
}

then it complains about the invalid provider:

[2022-07-29T14:24:36.000Z][LOGMONITOR] ERROR: Invalid providers.

I read the source code and I see it is probing every named provider for GUID

for (auto provider : Providers)
{
if (provider.ProviderGuidStr.empty())
{
if (!provider.ProviderName.empty())
{
wstring providerName(provider.ProviderName);
transform(
providerName.begin(), providerName.end(),
providerName.begin(),
towlower);
providersWithoutGuid[providerName] = (provider);
}
}
else
{
ValidProviders.push_back(provider);
}
}
//
// Return now if there aren't providers that need to obtain theirs GUID.
//
if (providersWithoutGuid.empty())
{
return status;
}

It would be nice to allow logs access by named providers only, without GUID.

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions