Remove some allocations related to logging configuration (#50055)
* Remove some allocations related to logging configuration
- Today we allocate enumerators when enumerating custom attributes, this changes a for loop into a foreach and removes the inner foreach loop.
* Remove enumerator allocation from rules selector
* Make condition clearer
* Update src/libraries/Microsoft.Extensions.Logging/src/LoggerFilterOptions.cs
Co-authored-by: Jonas Nyrup <78789299+jn-foreflight@users.noreply.github.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Jonas Nyrup <78789299+jn-foreflight@users.noreply.github.com>