Skip to content

Do not log exception call stacks for cancellations in RequestLoggingMiddleware #372

Open
@cremor

Description

@cremor

Is your feature request related to a problem? Please describe.
When a client cancels a request the RequestLoggingMiddleware will log the stack trace of the TaskCanceledException.

Describe the solution you'd like
RequestLoggingMiddleware should not log exception strack traces for cancellations.

Describe alternatives you've considered
Maybe make it configurable. But I can't see a reason why anyone would want stack traces for cancellations.

Additional context
Related to #341 but not the same. You might want to log "real" exceptions but cancellation exceptions are always spam.
This could be implemented in the same way as DeveloperExceptionPageMiddlewareImpl or ExceptionHandlerMiddlewareImpl implements it.
It would be a good idea to also fix the status code for cancellations at the same time (related to #344).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions