Skip to content

Commit 5a58ea6

Browse files
committed
Enhance audit logging and redesign audit center UI
- Add correlation and request IDs to AuditHttpMiddleware logs - Redesign Audits.razor with expanded filter options and modern UI - Implement server-side paging, sorting, and inline row details - Add export to CSV/JSON and quick-range filter buttons - Use enums for event type/severity with improved formatting - Refactor filter and table state logic for better UX and performance
1 parent e1da827 commit 5a58ea6

File tree

3 files changed

+458
-69
lines changed

3 files changed

+458
-69
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,4 +489,5 @@ $RECYCLE.BIN/
489489

490490
team/
491491
fshuser/
492-
docs/
492+
docs/
493+
spec-os/

src/Modules/Auditing/Modules.Auditing/Infrastructure/Http/AuditHttpMiddleware.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ await Audit.ForActivity(Contracts.ActivityKind.Http, ctx.Request.Path)
8383
.WithSource("api")
8484
.WithTenant((_publisher.CurrentScope?.TenantId) ?? null)
8585
.WithUser(_publisher.CurrentScope?.UserId, _publisher.CurrentScope?.UserName)
86+
.WithCorrelation(_publisher.CurrentScope?.CorrelationId ?? ctx.TraceIdentifier)
87+
.WithRequestId(_publisher.CurrentScope?.RequestId ?? ctx.TraceIdentifier)
8688
.WriteAsync(ctx.RequestAborted);
8789
}
8890
catch (Exception ex)
@@ -97,6 +99,8 @@ await Audit.ForException(ex, ExceptionArea.Api,
9799
.WithSource("api")
98100
.WithTenant((_publisher.CurrentScope?.TenantId) ?? null)
99101
.WithUser(_publisher.CurrentScope?.UserId, _publisher.CurrentScope?.UserName)
102+
.WithCorrelation(_publisher.CurrentScope?.CorrelationId ?? ctx.TraceIdentifier)
103+
.WithRequestId(_publisher.CurrentScope?.RequestId ?? ctx.TraceIdentifier)
100104
.WriteAsync(ctx.RequestAborted);
101105
}
102106

@@ -112,4 +116,3 @@ private bool ShouldSkip(HttpContext ctx)
112116
path.StartsWith(prefix, StringComparison.OrdinalIgnoreCase));
113117
}
114118
}
115-

0 commit comments

Comments
 (0)