Skip to content
New issue

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

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

Already on GitHub? # to your account

Ability to customize LogEventLevel used in UseSerilogRequestLogging middleware #132

Merged
merged 5 commits into from
Oct 2, 2019

Conversation

seroche
Copy link
Contributor

@seroche seroche commented Sep 17, 2019

FEATURE: add ability to customize the LogEventLevel used by the middleware
FEATURE: add new dependency injection overload to offer more flexibility while configuring options

…eware

FEATUREL add new dependency injection overloads to offer more flexibility while configuring options
@seroche seroche changed the title Ability to customize LogEventLevel in middleware Ability to customize LogEventLevel used in UseSerilogRequestLogging middleware Sep 17, 2019
Copy link
Member

@nblumhardt nblumhardt left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Added a few comments. I'm offline for a few days in the middle of this week, so apologies if any replies are delayed.

samples/InlineInitializationSample/Startup.cs Outdated Show resolved Hide resolved
src/Serilog.AspNetCore/RequestLoggingOptions.cs Outdated Show resolved Hide resolved
src/Serilog.AspNetCore/RequestLoggingOptions.cs Outdated Show resolved Hide resolved
src/Serilog.AspNetCore/RequestLoggingOptions.cs Outdated Show resolved Hide resolved
Sebastien Roche added 2 commits September 17, 2019 16:18
FEATURE: use default empty overload in sample
FEATURE: rename GetLogEventLevel to GetLogLevel
Copy link
Member

@nblumhardt nblumhardt left a comment

Choose a reason for hiding this comment

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

Thanks! Looking good. Just a few minor notes/nitpicks.

…standards

REFACTORING: renamed GetLogLevel to GetLevel
@seroche
Copy link
Contributor Author

seroche commented Sep 18, 2019

Hopefully this should be good now :)

… is useful when an exception is thrown but HttpStatusCode is not yet set to 500 InternalServerError

FIX: DefaultGetLevel now returns Error if there is an exception OR if StatusCode > 499
@seroche
Copy link
Contributor Author

seroche commented Oct 2, 2019

Hello, any plan to merge this soon?

@nblumhardt nblumhardt merged commit 25af04c into serilog:dev Oct 2, 2019
@nblumhardt
Copy link
Member

Done! Thanks. I think if I get a chance I'll investigate adding double elapsedMS to the parameter list of GetLevel, since I expect some people will want to emit warnings if requests exceed a certain threshold.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants