< Summary

Information
Class: Elsa.Diagnostics.StructuredLogs.Options.StructuredLogsOptions
Assembly: Elsa.Diagnostics.StructuredLogs
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Diagnostics.StructuredLogs/Options/StructuredLogsOptions.cs
Line coverage
100%
Covered lines: 25
Uncovered lines: 0
Coverable lines: 25
Total lines: 40
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_RecentLogCapacity()100%11100%
get_SubscriberChannelCapacity()100%11100%
get_MaxRecentLogQuerySize()100%11100%
get_SourceHeartbeatTimeout()100%11100%
get_IncludeStructuredLogsInternalLogs()100%11100%
get_SensitiveNames()100%11100%
.ctor()100%11100%
get_SensitiveTextPatterns()100%11100%
ClampRecentLogQueryTake(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Diagnostics.StructuredLogs/Options/StructuredLogsOptions.cs

#LineLine coverage
 1namespace Elsa.Diagnostics.StructuredLogs.Options;
 2
 3public class StructuredLogsOptions
 4{
 1035    public int RecentLogCapacity { get; set; } = 5_000;
 646    public int SubscriberChannelCapacity { get; set; } = 1_000;
 7    /// <summary>
 8    /// Default <c>Take</c> and upper clamp for recent-log queries on every <c>IStructuredLogStore</c> implementation.
 9    /// Negative values are treated as zero so query construction never throws.
 10    /// </summary>
 13511    public int MaxRecentLogQuerySize { get; set; } = 1_000;
 9212    public TimeSpan SourceHeartbeatTimeout { get; set; } = TimeSpan.FromSeconds(30);
 813    public bool IncludeStructuredLogsInternalLogs { get; set; }
 14
 1215    public ICollection<string> SensitiveNames { get; set; } =
 4916    [
 4917        "authorization",
 4918        "token",
 4919        "password",
 4920        "secret",
 4921        "api-key",
 4922        "apikey",
 4923        "cookie",
 4924        "connection-string",
 4925        "connectionstring"
 4926    ];
 27
 1228    public ICollection<string> SensitiveTextPatterns { get; set; } =
 4929    [
 4930        "(?i)bearer\\s+[A-Za-z0-9._~+/=-]+",
 4931        "(?i)(password|secret|token|api[-_]?key)\\s*[=:]\\s*[^\\s,;]+",
 4932        "(?i)(AccountKey|SharedAccessKey)=([^;\\s]+)"
 4933    ];
 34
 35    public int ClampRecentLogQueryTake(int? take)
 36    {
 4737        var maxTake = Math.Max(0, MaxRecentLogQuerySize);
 4738        return Math.Clamp(take ?? maxTake, 0, maxTake);
 39    }
 40}