Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure logging internally to not filter out Debug messages #9080

Merged
merged 1 commit into from
Jul 6, 2017

Conversation

ajcvickers
Copy link
Contributor

@ajcvickers ajcvickers commented Jul 6, 2017

Issue #9083

Added default configuration when we add logging to our service provider. Doesn't get used when the ILoggerFactory comes in from the outside.

Also, refactored DbContextTest into three files since it was getting too big for R#. Since the diff may be hard to read, the three tests added were:

  • Can_log_debug_events_with_OnConfiguring
  • Cannot_log_debug_events_with_default_UseLoggerFactory
  • Can_log_debug_events_with_UseLoggerFactory_when_configured

@divega
Copy link
Contributor

divega commented Jul 6, 2017

It seems AppVeyor fails on one of the new tests.

@ajcvickers ajcvickers changed the title Add tests that traditional dynamic logging still logs debug messages Configure logging internally to not filter out Debug messages Jul 6, 2017
@ajcvickers
Copy link
Contributor Author

ajcvickers commented Jul 6, 2017

@divega Super weird. It passed on both my machines, but not on AppVeyer. I made the change that I thought we needed to make in the first place and now it is passing on my machines and on AppVeyer.

Copy link
Contributor

@smitpatel smitpatel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤞 too large diff but the 3 tests looks fine.

It turns out that this still works if and only if the app is not using AddDbContext/UseLoggerFactory. However, if the app is using AddDbContext/UseLoggerFactory and logging is correctly figured in the service provider from which these things come to not filter Debug messages, then this works too. So it's all super weird and hard to understand, but I think we already have the behavior we talked about this morning.

Also, refactored DbContextTest into three files since it was getting too big for R#. Since the diff may be hard to read, the three tests added were:
* Can_log_debug_events_with_OnConfiguring
* Cannot_log_debug_events_with_default_UseLoggerFactory
* Can_log_debug_events_with_UseLoggerFactory_when_configured
@ajcvickers ajcvickers merged commit 2a70de4 into dev Jul 6, 2017
@smitpatel smitpatel deleted the LogMeBaby0705 branch July 7, 2017 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants