<PackageReference Include="NLog" Version="6.0.6" />

NLog.Filters.Filter

public abstract class Filter
An abstract filter class. Provides a way to eliminate log messages based on properties other than logger name and log level.
public FilterResult Action { get; set; }

Gets or sets the action to be taken when filter matches.

protected Filter()

Initializes a new instance of the Filter class.

protected abstract FilterResult Check(LogEventInfo logEvent)

Checks whether log event should be logged or not.