NLogRequestLoggingModule - Introduce ShouldLogRequest

Open
#1,075 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp

Research direction

Compare the existing ShouldLogRequest behavior on NLogRequestLoggingMiddleware with NLogRequestLoggingModule, then review the module's request and exception logging entry points. Clarify whether the requested change is only the predicate API or also reduced exception logging for informational levels and canceled ASP.NET Core requests. Done means the agreed behavior is consistently available for the module.

Written by the indexing model from the issue text.

Description

up-for-grabs

Like ShouldLogRequest is available for NLogRequestLoggingMiddleware, so one can downgrade LogLevel, then it should always be available for NLogRequestLoggingModule.

Maybe consider changing the logging so when LogLevel <= Info, then skip logging the exception. But just perform logging of the Exception.Type and Exception.Message (Ex. Input-Validation-Errors).

This could also be useful for ASP.NET Core, where HTTP 499 Client Closed Request together with TaskCanceledException should not be seen as "Error" (catch (OperationCanceledException) when (httpContext.RequestAborted.IsCancellationRequested))

Dominant language
C#
Stars
327
Forks
161
Avg merge
1d 41m
Merged PRs (30d)
7

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NLog/NLog.Web

All issues in NLog/NLog.Web

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.