Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

FilterLogger should respect inner logger's IsEnabled #534

Closed
andriysavin opened this issue Dec 14, 2016 · 4 comments
Closed

FilterLogger should respect inner logger's IsEnabled #534

andriysavin opened this issue Dec 14, 2016 · 4 comments
Assignees
Labels
Milestone

Comments

@andriysavin
Copy link

andriysavin commented Dec 14, 2016

Currently, at https://github.com/aspnet/Logging/blob/dev/src/Microsoft.Extensions.Logging.Filter/Internal/FilterLogger.cs#L27 only provided filter is respected. But this functionality will likely be used for integration with existing logging frameworks, which may have their own filtering system. Why not respect it at least like this:
public bool IsEnabled(LogLevel logLevel) { return _filter(logLevel) && _innerLogger.IsEnabled(logLevel); }

In other words, this filtering decorator should augment inner logger's filtering, not replace it.

@HaoK
Copy link
Member

HaoK commented Jun 14, 2017

@pakrym was this fixed by your changes?

@pakrym
Copy link
Contributor

pakrym commented Jun 14, 2017

Should be fixed, but I haven't verified.

@muratg
Copy link

muratg commented Jun 14, 2017

Assigning to @pakrym for investigation.

@muratg muratg added this to the 2.0.0 milestone Jun 14, 2017
@pakrym
Copy link
Contributor

pakrym commented Jun 14, 2017

Microsoft.Extensions.Logging.Filter is getting removed. New way of adding filters has this fixed.

@pakrym pakrym closed this as completed Jun 14, 2017
@pakrym pakrym added 3 - Done and removed 1 - Ready labels Jun 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants