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

Allow configuration of logging level for specific events #14972

Merged
merged 1 commit into from
Mar 12, 2019

Conversation

ajcvickers
Copy link
Member

Issue #14970

Example API:

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    => optionsBuilder
        .UseInMemoryDatabase("MyDb")
        .ConfigureWarnings(c => c.Log((CoreEventId.CascadeDelete, LogLevel.Warning)));

Mitigates the breaking change of #14523.

Also, makes initialization of logging definitions lazy. We have quite a lot and eagerly initializing all of them the first time any string resource is used was bothering me.

Also, stopped including Exception in logging definition since this causes the stack trace to be included in the log even if the exception has been handled. The exception is still available in diagnostics.

}


/// <summary>
Copy link
Member

Choose a reason for hiding this comment

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

Extra line

Copy link
Member

@AndriySvyryd AndriySvyryd left a comment

Choose a reason for hiding this comment

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

:shipit:

Issue #14970

Example API:
```C#
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    => optionsBuilder
        .UseInMemoryDatabase("MyDb")
        .ConfigureWarnings(c => c.Log((CoreEventId.CascadeDelete, LogLevel.Warning)));

```

Mitigates the breaking change of #14523.

Also, makes initialization of logging definitions lazy. We have quite a lot and eagerly initializing all of them the first time any string resource is used was bothering me.

Also, stopped including Exception in logging definition since this causes the stack trace to be included in the log even if the exception has been handled. The exception is still available in diagnostics.
@ajcvickers ajcvickers force-pushed the WeGonnaFightThePowersThatBe0308 branch from e7264a9 to ee9fd74 Compare March 11, 2019 21:54
@ajcvickers ajcvickers merged commit 031e73a into master Mar 12, 2019
@smitpatel smitpatel deleted the WeGonnaFightThePowersThatBe0308 branch March 13, 2019 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants