< Summary

Information
Class: ProjectTemplate.Web.Options.ApplicationRequestLoggingOptions
Assembly: ProjectTemplate.Web
File(s): /home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/src/ProjectTemplate.Web/Options/ApplicationRequestLoggingOptions.cs
Line coverage
100%
Covered lines: 16
Uncovered lines: 0
Coverable lines: 16
Total lines: 53
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_SectionName()100%11100%
get_Enabled()100%11100%
get_CorrelationHeaderName()100%11100%
get_IncludeQueryString()100%11100%
get_IncludeUserName()100%11100%
get_IncludeRemoteIpAddress()100%11100%
get_ExcludedPathPrefixes()100%11100%
.ctor()100%11100%

File(s)

/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/src/ProjectTemplate.Web/Options/ApplicationRequestLoggingOptions.cs

#LineLine coverage
 1namespace ProjectTemplate.Web.Options;
 2
 3/// <summary>
 4/// Options controlling structured HTTP request logging behavior.
 5/// </summary>
 6public sealed class ApplicationRequestLoggingOptions
 7{
 8    /// <summary>
 9    /// Gets the configuration section name used to bind request logging settings.
 10    /// </summary>
 18811    public static string SectionName { get; internal set; } = "ProjectTemplate:RequestLogging";
 12
 13    /// <summary>
 14    /// Gets or sets a value indicating whether structured request logging is enabled.
 15    /// </summary>
 73816    public bool Enabled { get; set; } = true;
 17
 18    /// <summary>
 19    /// Gets or sets the request/response header used for request correlation.
 20    /// </summary>
 128621    public string CorrelationHeaderName { get; set; } = "X-Correlation-ID";
 22
 23    /// <summary>
 24    /// Gets or sets a value indicating whether the query string should be logged.
 25    /// Disabled by default because query strings may contain sensitive values.
 26    /// </summary>
 37227    public bool IncludeQueryString { get; set; }
 28
 29    /// <summary>
 30    /// Gets or sets a value indicating whether authenticated user names should be logged.
 31    /// </summary>
 67832    public bool IncludeUserName { get; set; } = true;
 33
 34    /// <summary>
 35    /// Gets or sets a value indicating whether the remote IP address should be logged.
 36    /// </summary>
 67837    public bool IncludeRemoteIpAddress { get; set; } = true;
 38
 39    /// <summary>
 40    /// Gets or sets path prefixes that should be excluded from normal request logging.
 41    /// Matching requests are logged at Verbose level so the default sinks suppress them.
 42    /// </summary>
 96043    public List<string> ExcludedPathPrefixes { get; set; } =
 30644    [
 30645        "/health",
 30646        "/metrics",
 30647        "/favicon.ico",
 30648        "/css",
 30649        "/js",
 30650        "/lib",
 30651        "/_framework"
 30652    ];
 53}