Skip to content

Support alternate delimiter in EventSourceLogger FilterSpecs #36399

@analogrelay

Description

@analogrelay

Right now, the delimiter that separates individual filter specs in the EventSource logger provider is ;. So multiple filter specs are provided as: Microsoft:Information;System:Information;MyApp:Trace

However, when this is encoded into an .eventpipeconfig file, it ends up looking like this:

Providers=Microsoft-Extensions-Logging:0x4:0:FilterSpecs=Microsoft:Information;SampleWebApp:Trace

The problem is that ; is also the delimiter between individual key/value "parameters" in the .eventpipeconfig file, so if an EventPipe Provider had two key/value pairs (A and B) you'd configure them like this:

Providers=MyProvider:0:0:A=1;B=2, ... other providers ...

Because of this conflict, only the first filter spec actually makes it all the way to EventSourceLogger.

There are a few ways to resolve this:

  1. Change coreclr to use a different delimiter other than ; for their parameters, or to support "quoting" or "escaping" of some form (cc @vancem for considering the feasibility of this, given it's already shipped :)).
  2. Change EventSourceLogger to support an alternate delimiter (such as |). There are a few ways we could do this:
    a. Use IndexOf to check for one or the other and determine which path to go along
    b. Support using both in a single string
    c. Use a new parameter name (FilterSpecs2) to represent the "new" format.

cc @pakrym @davidfowl

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions