![]() |
VOOZH | about |
dotnet add package AsGuard --version 0.1.12
NuGet\Install-Package AsGuard -Version 0.1.12
<PackageReference Include="AsGuard" Version="0.1.12" />
<PackageVersion Include="AsGuard" Version="0.1.12" />Directory.Packages.props
<PackageReference Include="AsGuard" />Project file
paket add AsGuard --version 0.1.12
#r "nuget: AsGuard, 0.1.12"
#:package AsGuard@0.1.12
#addin nuget:?package=AsGuard&version=0.1.12Install as a Cake Addin
#tool nuget:?package=AsGuard&version=0.1.12Install as a Cake Tool
AsGuard is an ASP.NET Core monitoring package for request logging, exception tracking, host ILogger capture, live Server-Sent Events (SSE) updates, and a built-in dashboard.
It is intended for applications that need practical visibility into HTTP traffic and application warnings/errors without wiring a separate observability platform first.
UserId, custom searchable Tags, and structured MetadataJson metadata) via claims, DI-based enrichers, or inline options delegates.ILogger capture for warnings and errors by default.IExceptionLogger.WebApplication or IApplicationBuilder.Install the package in the host application:
dotnet add package AsGuard
For local development from this repository, pack and install the generated package into your host app:
dotnet pack -c Release
dotnet add package AsGuard --source ./bin/Release
using AsGuard.Domain.RequestLogging;
using AsGuard.Extensions;
using AsGuard.Services;
using Microsoft.Extensions.Logging;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRequestLogging(options =>
{
options.DatabaseProvider = LoggingDatabaseProvider.Sqlite;
options.ConnectionString = "Data Source=AsGuard.db";
options.DashboardRoute = "/request-logs-ui";
options.DashboardUsername = builder.Configuration["AsGuard:DashboardUsername"]!;
options.DashboardPassword = builder.Configuration["AsGuard:DashboardPassword"]!;
options.EnableExceptionLogging = true;
options.CaptureHostLogs = true;
options.HostLogMinimumLevel = LogLevel.Warning;
});
var app = builder.Build();
// If you use ASP.NET Core exception handling, register it before UseRequestLogging().
app.UseExceptionHandler("/error");
app.UseRequestLogging();
app.MapGet("/demo-warning", (ILogger<Program> logger) =>
{
logger.LogWarning("This warning is captured by AsGuard.");
return Results.Ok();
});
app.MapGet("/demo-error", () =>
{
throw new InvalidOperationException("Unhandled sample error.");
});
app.Run();
Open the dashboard:
/request-logs-ui
The dashboard, API, and SSE stream use HTTP Basic Authentication with DashboardUsername and DashboardPassword.
Call app.UseRequestLogging() after building the app and before the endpoints you want monitored.
var app = builder.Build();
app.UseExceptionHandler("/error");
app.UseRequestLogging();
app.MapControllers();
app.Run();
UseRequestLogging() adds:
builder.Services.AddRequestLogging(options =>
{
// Storage
options.DatabaseProvider = LoggingDatabaseProvider.SqlServer;
options.ConnectionString = builder.Configuration.GetConnectionString("AsGuard")!;
// Request queue and persistence
options.QueueCapacity = 10_000;
options.QueueOverflowPolicy = QueueOverflowPolicy.DropNewest;
options.BatchSize = 100;
// Exception and host ILogger capture
options.EnableExceptionLogging = true;
options.EnableApmTracing = true;
options.ExceptionQueueCapacity = 5_000;
options.ExceptionQueueOverflowPolicy = QueueOverflowPolicy.DropNewest;
options.ExceptionBatchSize = 50;
options.CaptureHostLogs = true;
options.HostLogMinimumLevel = LogLevel.Warning;
options.ExcludedHostLogCategoryPrefixes.Add("Microsoft.");
options.ExcludedHostLogCategoryPrefixes.Add("System.");
// In-memory store limit
options.MaxInMemoryEntries = 10_000;
// Live broadcast (SSE delivery)
options.BroadcastQueueCapacity = 2_048;
options.BroadcastOverflowPolicy = BroadcastOverflowPolicy.DropOldest;
options.BroadcastDetailMode = BroadcastDetailMode.SummaryOnly;
// Detail APIs
options.EnableDetailedLogEndpoint = true;
// Correlation
options.CorrelationHeaderName = "X-Correlation-ID";
// Retention
options.RequestRetentionDays = 30;
options.ExceptionRetentionDays = 90;
options.RetentionCleanupInterval = TimeSpan.FromHours(6);
// Alerts
options.QueuePressureAlertThreshold = 0.8;
options.ExceptionSpikeAlertThreshold = 25;
options.ExceptionSpikeAlertWindow = TimeSpan.FromMinutes(5);
options.AlertCooldown = TimeSpan.FromMinutes(5);
// Body capture
options.LogRequestBody = false;
options.LogResponseBody = false;
options.MaxCapturedBodyBytes = 4_096;
options.LoggableContentTypes =
[
"application/json",
"application/xml",
"text/",
"application/x-www-form-urlencoded"
];
// Redaction
options.SensitiveHeaders.Add("X-Internal-Token");
// Path exclusions
options.ExcludedPathPrefixes.Add("/internal");
options.ExcludedExactPaths.Add("/ready");
// Dashboard and protected AsGuard endpoints
options.DashboardRoute = "/request-logs-ui";
options.DashboardUsername = builder.Configuration["AsGuard:DashboardUsername"]!;
options.DashboardPassword = builder.Configuration["AsGuard:DashboardPassword"]!;
});
Use DatabaseProvider to choose where logs are persisted.
| Provider | Value | Connection string |
|---|---|---|
| SQL Server | LoggingDatabaseProvider.SqlServer |
Required |
| PostgreSQL | LoggingDatabaseProvider.PostgreSql |
Required |
| SQLite | LoggingDatabaseProvider.Sqlite |
Required |
| In-memory | LoggingDatabaseProvider.InMemory |
Not used |
options.DatabaseProvider = LoggingDatabaseProvider.SqlServer;
options.ConnectionString = builder.Configuration.GetConnectionString("AsGuard")!;
options.DatabaseProvider = LoggingDatabaseProvider.PostgreSql;
options.ConnectionString = builder.Configuration.GetConnectionString("AsGuard")!;
options.DatabaseProvider = LoggingDatabaseProvider.Sqlite;
options.ConnectionString = "Data Source=AsGuard.db";
options.DatabaseProvider = LoggingDatabaseProvider.InMemory;
options.MaxInMemoryEntries = 10_000;
In-memory storage is process-local and is cleared when the application stops.
The dashboard route is controlled by DashboardRoute.
options.DashboardRoute = "/request-logs-ui";
options.DashboardUsername = builder.Configuration["AsGuard:DashboardUsername"]!;
options.DashboardPassword = builder.Configuration["AsGuard:DashboardPassword"]!;
The dashboard supports:
Dashboard credentials are required when DashboardRoute is enabled. The legacy default credentials admin / admin are rejected at startup.
AsGuard registers an ILoggerProvider. Host app logs at Warning and above are captured by default and stored with exception/log events.
app.MapGet("/checkout", (ILogger<Program> logger) =>
{
logger.LogWarning("Payment retry required for order {OrderId}", 123);
return Results.Ok();
});
Configure the minimum level:
options.CaptureHostLogs = true;
options.HostLogMinimumLevel = LogLevel.Information;
Exclude noisy categories:
options.ExcludedHostLogCategoryPrefixes.Add("Microsoft.");
options.ExcludedHostLogCategoryPrefixes.Add("System.");
options.ExcludedHostLogCategoryPrefixes.Add("MyApp.NoisyWorker");
AsGuard excludes AsGuard. categories by default to avoid capturing its own internal logs.
If your host app calls builder.Logging.ClearProviders(), call it before builder.Services.AddRequestLogging(...). Clearing providers after AddRequestLogging(...) can remove the AsGuard logger provider.
Unhandled HTTP exceptions are captured when EnableExceptionLogging is enabled.
options.EnableExceptionLogging = true;
app.MapGet("/throw", () =>
{
throw new InvalidOperationException("Captured by AsGuard.");
});
AsGuard rethrows the exception after capturing it, so the host app's normal exception handling still controls the HTTP response.
Use IExceptionLogger for background jobs, message handlers, scheduled tasks, or exceptions that are handled manually.
app.MapPost("/background-exception", async (IExceptionLogger exceptionLogger) =>
{
try
{
throw new ApplicationException("Manual exception sample.");
}
catch (Exception ex)
{
await exceptionLogger.LogAsync(
ex,
LogLevel.Error,
new ExceptionLogContext(
Path: "/background-exception",
Method: "POST",
UserId: "user-123",
Tags: "manual-api",
MetadataJson: """{"job":"billing-sync"}"""));
}
return Results.Ok();
});
ExceptionLogContext supports:
| Property | Purpose |
|---|---|
CorrelationId |
Existing correlation ID. If omitted, AsGuard uses the current request correlation ID or creates one. |
Path |
Request or operation path. |
Method |
HTTP method or operation verb. |
UserId |
Current user identifier. |
ClientIp |
Client IP address. |
RequestId |
Request identifier. |
Tags |
Searchable labels such as background-job or payment. |
MetadataJson |
Custom JSON metadata. |
OccurredOnUtc |
Override event timestamp. |
Body capture is disabled by default.
options.LogRequestBody = true;
options.LogResponseBody = true;
options.MaxCapturedBodyBytes = 8_192;
Only configured content types are captured. If LoggableContentTypes is left empty (the default), all content types will be captured:
// Limit body capture to specific content types
options.LoggableContentTypes =
[
"application/json",
"text/",
"application/x-www-form-urlencoded"
];
Unsupported content types are stored as a skipped marker. Captured bodies are truncated when they exceed MaxCapturedBodyBytes.
Use body capture carefully in production. Request and response bodies can contain credentials, tokens, personal data, or regulated data.
By default, the Set-Cookie response header is always redacted.
Other sensitive headers (such as Authorization, Cookie, or X-Api-Key) are not redacted by default. You should explicitly add them to the SensitiveHeaders collection:
options.SensitiveHeaders.Add("Authorization");
options.SensitiveHeaders.Add("Cookie");
options.SensitiveHeaders.Add("X-Api-Key");
options.SensitiveHeaders.Add("X-Internal-Token");
options.SensitiveHeaders.Add("X-Session-Id");
Set-Cookie response headers are always redacted.
You can automatically redact sensitive data (like passwords, tokens, or PII) from captured request and response JSON bodies.
Simply apply the [AsGuardMasked] attribute to the sensitive properties in your models:
using AsGuard.Domain.RequestLogging;
public class LoginRequest
{
public string Username { get; set; }
[AsGuardMasked]
public string Password { get; set; }
}
AsGuard scans your assemblies at startup to discover these attributes (respecting [JsonPropertyName]). When it captures a JSON body containing these keys, it automatically replaces their values with "[REDACTED]" before saving the log. The actual response returned to the client is completely unaffected.
You can also manually add keys to be masked via options:
options.SensitiveBodyKeys.Add("creditCardNumber");
AsGuard supports enriching request logs with additional context, enabling you to extract and store:
UserId: The identifier of the logged-in user making the request.Tags: Custom searchable tags (e.g. "api,public,v2").MetadataJson: Structured JSON metadata (e.g. {"tenant":"emea", "clientId":"mobile-app"}).These fields are persistent, fully searchable via the dashboard/API, and indexable in SQL databases.
By default, AsGuard automatically populates the UserId property by searching the request user's claims for common claim types:
ClaimTypes.NameIdentifiersub (Subject claim)If found, these are mapped automatically without any extra configuration.
For quick and simple enrichment, use the EnrichLog delegate option inside AddRequestLogging:
builder.Services.AddRequestLogging(options =>
{
options.DatabaseProvider = LoggingDatabaseProvider.Sqlite;
options.ConnectionString = "Data Source=AsGuard.db";
options.EnrichLog = (context, log) =>
{
// Custom UserId extraction
if (context.Request.Headers.TryGetValue("X-Client-Id", out var clientId))
{
log.UserId = clientId;
}
// Add custom searchable tags
log.Tags = "custom-tag,v2";
// Add structured custom metadata using the Metadata dictionary
log.Metadata["region"] = "eu-west-1";
log.Metadata["environment"] = "production";
};
});
For more complex enrichment requiring external services (such as looking up database records, caching, or resolving configuration), define an enrichment service by implementing IAsGuardRequestEnricher:
using AsGuard.Domain.RequestLogging;
using AsGuard.Services;
using Microsoft.AspNetCore.Http;
public class TenantRequestEnricher : IAsGuardRequestEnricher
{
private readonly ITenantService _tenantService;
public TenantRequestEnricher(ITenantService tenantService)
{
_tenantService = tenantService;
}
public void Enrich(HttpContext context, RequestLog log)
{
var tenantInfo = _tenantService.GetCurrentTenant();
if (tenantInfo != null)
{
log.Tags = string.IsNullOrEmpty(log.Tags)
? tenantInfo.Code
: $"{log.Tags},{tenantInfo.Code}";
// Enrich with custom structured metadata using the Metadata dictionary
log.Metadata["tenantId"] = tenantInfo.Id;
log.Metadata["tier"] = tenantInfo.SubscriptionTier;
}
}
}
Then, register your enricher in the Dependency Injection container:
builder.Services.AddScoped<IAsGuardRequestEnricher, TenantRequestEnricher>();
Performance Guidance: Log enrichment runs inside the HTTP request middleware pipeline context to ensure all request details (route data, headers, claims) are fully available. Keep all custom enricher operations fast and non-blocking to prevent adding latency to API requests.
AsGuard reads and writes the configured correlation header. The default is X-Correlation-ID.
options.CorrelationHeaderName = "X-Correlation-ID";
If the incoming request has a valid correlation ID, AsGuard uses it. Otherwise it creates a new one. The value is assigned to HttpContext.TraceIdentifier and returned on the response header.
Accepted incoming correlation IDs contain only letters, digits, hyphens, and underscores, and must be 128 characters or shorter.
AsGuard skips common operational endpoints by default:
/health, /swagger, /metrics/health, /metrics, /swagger, /favicon.icoThe dashboard route, /request-logs-api, and /request-logs-stream are also skipped automatically.
Add exclusions:
options.ExcludedPathPrefixes.Add("/internal");
options.ExcludedPathPrefixes.Add("/jobs");
options.ExcludedExactPaths.Add("/ready");
Prefix exclusions are case-insensitive and use path-prefix matching. Exact exclusions are case-insensitive exact matches.
By default, AsGuard logs 100% of the non-excluded requests. For high-traffic applications, you can reduce storage and queue pressure by configuring sampling and filtering logic.
// 1. Request Sampling (e.g., log only 10% of traffic)
options.SamplingRate = 0.1;
// 2. Threshold-Based Logging (e.g., log requests taking longer than 500ms)
options.LogRequestsSlowerThan = TimeSpan.FromMilliseconds(500);
// 3. Status Code Specific Logging (e.g., log only 400 and 500 responses)
options.LoggableStatusCodes.Add(400);
options.LoggableStatusCodes.Add(500);
Note: Any request that throws an unhandled exception will always be logged, bypassing these sampling and filtering rules.
AsGuard queues logs in memory and persists them from background workers.
options.QueueCapacity = 10_000;
options.BatchSize = 100;
options.QueueOverflowPolicy = QueueOverflowPolicy.DropNewest;
options.ExceptionQueueCapacity = 5_000;
options.ExceptionBatchSize = 50;
options.ExceptionQueueOverflowPolicy = QueueOverflowPolicy.DropNewest;
Overflow policies:
| Policy | Behavior |
|---|---|
DropNewest |
Drop the new item when the queue is full. |
DropOldest |
Remove the oldest queued item and enqueue the new item. |
Use larger queues for bursty systems. Use smaller queues when memory pressure is more important than retaining every monitoring event.
The SSE stream endpoint is:
/request-logs-stream
The stream uses the same Basic Auth credentials as the dashboard.
Optional groups query parameter:
/request-logs-stream?groups=logs,exceptions
If omitted, both groups are streamed.
SSE payloads are JSON envelopes with:
| Field | Meaning |
|---|---|
method |
NewLogs or NewExceptions |
payload |
Array of newly persisted request logs or exception/log events |
Configure broadcast pressure behavior:
options.BroadcastQueueCapacity = 2_048;
options.BroadcastOverflowPolicy = BroadcastOverflowPolicy.DropOldest;
options.BroadcastDetailMode = BroadcastDetailMode.SummaryOnly;
Broadcast detail modes:
| Mode | Behavior |
|---|---|
SummaryOnly |
Sends compact live rows without large details. |
Full |
Includes metadata, stack traces, and inner exception data in live events. |
Configure automatic deletion of old logs:
options.RequestRetentionDays = 30;
options.ExceptionRetentionDays = 90;
options.RetentionCleanupInterval = TimeSpan.FromHours(6);
Set a retention value to null to disable cleanup for that log type.
AsGuard publishes alerts for:
Configure alert thresholds:
options.QueuePressureAlertThreshold = 0.8;
options.ExceptionSpikeAlertThreshold = 25;
options.ExceptionSpikeAlertWindow = TimeSpan.FromMinutes(5);
options.AlertCooldown = TimeSpan.FromMinutes(5);
Set QueuePressureAlertThreshold or ExceptionSpikeAlertThreshold to null to disable those alerts.
By default, alerts are written through ILogger.
Register your own IAsGuardAlertSink after AddRequestLogging to send alerts to email, Slack, Teams, webhooks, or another monitoring system.
builder.Services.AddRequestLogging(options =>
{
// options...
});
builder.Services.AddSingleton<IAsGuardAlertSink, WebhookAsGuardAlertSink>();
using AsGuard.Services;
public sealed class WebhookAsGuardAlertSink : IAsGuardAlertSink
{
public async ValueTask PublishAsync(AsGuardAlert alert, CancellationToken cancellationToken)
{
// Send alert.Type, alert.Message, alert.Properties, alert.OccurredOnUtc.
await Task.CompletedTask;
}
}
All API routes are protected by the same Basic Auth credentials as the dashboard.
GET /request-logs-api
Query parameters:
| Name | Type | Default | Description |
|---|---|---|---|
PageIndex |
int |
1 |
1-based page number. |
PageSize |
int |
20 |
Page size from 1 to 100. |
Search |
string |
Search text. | |
Method |
string |
HTTP method filter. | |
StatusCode |
int |
HTTP status code filter. | |
FromUtc |
DateTime |
Start UTC timestamp filter. | |
ToUtc |
DateTime |
End UTC timestamp filter. | |
UserId |
string |
Filter request logs by user ID. | |
ExceptionsOnly |
bool |
false |
Return only requests with captured exceptions. |
IncludeDetails |
bool |
false |
Include headers, bodies, and stack traces. |
SkipTotalCount |
bool |
false |
Skip total-count calculation for faster paging. |
Example:
GET /request-logs-api?PageIndex=1&PageSize=20&Method=POST&StatusCode=500
GET /request-logs-api/{id}
Returns full request log details. Disabled when EnableDetailedLogEndpoint is false.
DELETE /request-logs-api
Query parameters:
| Name | Type | Description |
|---|---|---|
FromUtc |
DateTime |
Delete logs on or after this UTC timestamp. |
ToUtc |
DateTime |
Delete logs on or before this UTC timestamp. |
Search |
string |
Delete matching logs. |
Method |
string |
Delete by HTTP method. |
StatusCode |
int |
Delete by HTTP status code. |
ExceptionsOnly |
bool |
Delete only requests with exceptions. |
Calling this endpoint without filters clears the request queue and all persisted request logs.
GET /request-logs-api/stats
Returns:
activeSignalRConnections).GET /request-logs-api/leaderboard
Query parameters:
| Name | Type | Default | Description |
|---|---|---|---|
Range |
string |
1h |
15m, 1h, 6h, 24h, or 7d. |
PageIndex |
int |
1 |
1-based page number. |
PageSize |
int |
20 |
Page size from 1 to 100. |
SortBy |
string |
p95 |
p50, p95, p99, errorRate, volume, path, or method. |
SortDir |
string |
desc |
asc or desc. |
Example:
GET /request-logs-api/leaderboard?Range=24h&SortBy=errorRate&SortDir=desc&PageIndex=1&PageSize=20
GET /request-logs-api/host-metrics
Returns an array of sampled HostMetricRecord values used by the dashboard metrics charts.
GET /request-logs-api/health
Executes registered ASP.NET Core health checks and returns overall status, total duration, detailed entries, and whether health checks are configured.
GET /request-logs-api/host-environment
Returns runtime host diagnostics such as machine name, OS/framework info, process architecture, startup time, uptime, and safe environment variables.
GET /request-logs-api/exceptions
This endpoint returns unhandled exceptions, manually logged exceptions, and captured host ILogger events.
Query parameters:
| Name | Type | Default | Description |
|---|---|---|---|
PageIndex |
int |
1 |
1-based page number. |
PageSize |
int |
20 |
Page size from 1 to 100. |
FromUtc |
DateTime |
Start UTC timestamp. | |
ToUtc |
DateTime |
End UTC timestamp. | |
Level |
LogLevel |
Trace, Debug, Information, Warning, Error, or Critical. |
|
CorrelationId |
string |
Correlation ID filter. | |
Search |
string |
Search text. | |
IncludeDetails |
bool |
false |
Include stack trace, inner exception, and metadata. |
SkipTotalCount |
bool |
false |
Skip total-count calculation for faster paging. |
Example:
GET /request-logs-api/exceptions?Level=Warning&PageSize=50
GET /request-logs-api/exceptions/{id}
Returns full exception/log event details. Disabled when EnableDetailedLogEndpoint is false.
GET /request-logs-api/exceptions/summary
Query parameters:
| Name | Type | Description |
|---|---|---|
FromUtc |
DateTime |
Start UTC timestamp. |
ToUtc |
DateTime |
End UTC timestamp. |
Returns total, critical, error, warning, information, debug, and trace counts.
GET /request-logs-api/exceptions/trends
Query parameters:
| Name | Type | Default | Description |
|---|---|---|---|
FromUtc |
DateTime |
Start UTC timestamp. | |
ToUtc |
DateTime |
End UTC timestamp. | |
Interval |
string |
hour |
hour or day. |
DELETE /request-logs-api/exceptions
Query parameters:
| Name | Type | Description |
|---|---|---|
FromUtc |
DateTime |
Delete events on or after this UTC timestamp. |
ToUtc |
DateTime |
Delete events on or before this UTC timestamp. |
Level |
LogLevel |
Delete by severity. |
CorrelationId |
string |
Delete by correlation ID. |
Search |
string |
Delete matching events. |
Calling this endpoint without filters clears the exception queue and all persisted exception/log events.
| Option | Default | Description |
|---|---|---|
DatabaseProvider |
SqlServer |
Storage provider. |
ConnectionString |
"" |
Connection string for SQL Server, PostgreSQL, or SQLite. |
QueueCapacity |
10_000 |
Request log queue capacity. |
QueueOverflowPolicy |
DropNewest |
Request queue overflow behavior. |
BatchSize |
100 |
Request log persistence batch size. |
EnableExceptionLogging |
true |
Enables exception/log event persistence. |
ExceptionQueueCapacity |
5_000 |
Exception/log event queue capacity. |
ExceptionQueueOverflowPolicy |
DropNewest |
Exception queue overflow behavior. |
ExceptionBatchSize |
50 |
Exception/log event persistence batch size. |
MaxInMemoryEntries |
10_000 |
Maximum retained rows for in-memory stores. |
BroadcastQueueCapacity |
2_048 |
Live broadcast queue capacity. |
BroadcastOverflowPolicy |
DropOldest |
Broadcast queue overflow behavior. |
BroadcastDetailMode |
SummaryOnly |
Live payload detail level for SSE events. |
EnableDetailedLogEndpoint |
true |
Enables detail endpoints. |
CaptureHostLogs |
true |
Captures host ILogger events. |
HostLogMinimumLevel |
Warning |
Minimum host ILogger level captured. |
ExcludedHostLogCategoryPrefixes |
AsGuard. |
Host logger categories excluded from capture. |
CorrelationHeaderName |
X-Correlation-ID |
Incoming/outgoing correlation header. |
RequestRetentionDays |
null |
Request log retention period. |
ExceptionRetentionDays |
null |
Exception/log event retention period. |
RetentionCleanupInterval |
6 hours |
Cleanup worker interval. |
QueuePressureAlertThreshold |
0.8 |
Queue depth ratio for pressure alerts. |
ExceptionSpikeAlertThreshold |
null |
Event count that triggers spike alerts. |
ExceptionSpikeAlertWindow |
5 minutes |
Spike alert rolling window. |
AlertCooldown |
5 minutes |
Minimum time between repeated alerts of the same type. |
MaxCapturedBodyBytes |
4_096 |
Maximum captured body/header characters before truncation. |
LogRequestBody |
false |
Captures request bodies. |
LogResponseBody |
false |
Captures response bodies. |
ExcludedPathPrefixes |
/health, /swagger, /metrics |
Case-insensitive path prefixes skipped by request logging. |
ExcludedExactPaths |
/health, /metrics, /swagger, /favicon.ico |
Case-insensitive exact paths skipped by request logging. |
LoggableContentTypes |
empty | Content types eligible for body capture. If empty (default), all content types are captured. |
SensitiveHeaders |
empty | Headers redacted from request/response logs. The Set-Cookie header is always redacted. |
SensitiveBodyKeys |
empty | JSON keys whose values should be redacted in request/response bodies. |
SamplingRate |
null |
Sample rate for request logging (0.0 to 1.0). Null means 100% logged. |
LogRequestsSlowerThan |
null |
Only requests slower than this threshold are logged. |
LoggableStatusCodes |
empty | If populated, only these HTTP status codes will be logged. |
DashboardRoute |
/request-logs-ui |
Dashboard route. Empty disables dashboard route mapping. |
DashboardUsername |
"" |
Basic Auth username. |
DashboardPassword |
"" |
Basic Auth password. |
admin / admin; AsGuard rejects those credentials.AddRequestLogging.ILogger.LogWarning does not show in the dashboardCheck:
CaptureHostLogs is true.HostLogMinimumLevel is Warning or lower.ExcludedHostLogCategoryPrefixes.builder.Logging.ClearProviders() after AddRequestLogging.EnableExceptionLogging is true, because host logs use the exception/log event pipeline.Check:
DashboardUsername and DashboardPassword are configured.admin / admin.Check:
LogRequestBody or LogResponseBody is enabled.LoggableContentTypes.MaxCapturedBodyBytes.Check:
/request-logs-api/stats for queue depth and dropped counts.QueueCapacity or ExceptionQueueCapacity.BatchSize or ExceptionBatchSize.| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 0.1.12 | 172 | 6/1/2026 | |
| 0.1.11 | 110 | 5/31/2026 | |
| 0.1.10 | 97 | 5/30/2026 | |
| 0.1.9 | 107 | 5/29/2026 | |
| 0.1.8 | 116 | 5/29/2026 | 0.1.8 is deprecated because it has critical bugs. |
| 0.1.7 | 125 | 5/24/2026 | |
| 0.1.6 | 108 | 5/22/2026 | |
| 0.1.5 | 103 | 5/15/2026 | |
| 0.1.4 | 110 | 5/9/2026 | |
| 0.1.3 | 141 | 5/7/2026 | 0.1.3 is deprecated because it is no longer maintained. |
| 0.1.2 | 147 | 5/1/2026 | 0.1.2 is deprecated because it is no longer maintained. |
| 0.1.1 | 152 | 5/1/2026 | 0.1.1 is deprecated because it is no longer maintained. |
| 0.1.0 | 163 | 4/28/2026 | 0.1.0 is deprecated because it is no longer maintained. |