Skip to content

Update Agent.cs to filter logs using level #1761

Closed
@jaffinito

Description

@jaffinito

Describe the story, please be clear on scope of the story.

This is one possible approach:

// we want to ignore case so that we don't have to normalize the deny-list values
if (_configurationService.Configuration.LogLevelDenylist.Contains(normalizedLevel, StringComparer.OrdinalIgnoreCase))
{
return;
}

Basically just add a .Contains using StringComparer.OrdinalIgnoreCase.

We want to avoid regex and wildcard to keep the logic simple and fast.

Add unit and integration tests. This could be updating existing tests to cover the new work or adding a new test completely.

Acceptance Criteria

  • Existing and new unit tests pass
  • Existing integration tests pass
  • New integration tests pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions