You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Modernize structured logging and redact HTTP request/response logs #1337
Modernize Shared.Logger and HTTP request/response logging in Shared.Middleware to emit structured, correlation-friendly events while reducing the risk of logging sensitive data.
Changes
Shared.Logger
Add message-template overloads with arguments across log levels, including exception-aware error and critical logging.
Emit NLog events with structured properties for event ID, UTC timestamp, service name, severity, tenant and merchant IDs, correlation ID, and distributed trace/span IDs when available.
Keep existing message-only APIs available with obsolescence guidance, and remove the Microsoft.Extensions.Logging adapter in favor of the NLog implementation.
Add a sample project demonstrating logger configuration and use.
Shared.Middleware
Emit structured HTTP request and response events with request ID, method/path/query, status code, elapsed time, headers, body capture status, and health-check classification.
Redact configured sensitive query, header, JSON, form, and XML values; filter headers through configurable allowlists.
Bound request and response body capture by configurable byte limits and report unsupported, oversized, or failed captures without logging the body.
Preserve request/response stream behavior and classify health-check paths case-insensitively.
Acceptance criteria
Logger events retain message-template arguments and include available tenant, correlation, and trace context.
Middleware logs only allowlisted headers and redacts configured sensitive values in supported body formats and query parameters.
Body capture limits and capture-status outcomes are configurable and represented in structured events.
The sample project demonstrates the updated logger API.
Activity