Skip to content

Debug request handler invocation

This operation is request-pipeline middleware that logs a Debug-level entry describing every incoming request before passing control to the rest of the pipeline.

Field Value
Operation ID OP-12
Trigger Any request through a pipeline configured with ConfigureDebugRequestHandling().
Inputs The HttpContext for the current request.
Outputs A Debug-level log entry; control passed to the next middleware.
Primary components DebugRequestHandler.InvokeAsync
Entry point src/SAIF.NetCore.ServiceExtensions/SAIF.NetCore.ServiceExtensions/SAIF.NetCore.ServiceExtensions/Middleware/DebugRequestHandler.cs (L36–46)

Steps

  1. Build a message from IEnvironmentClient.ApplicationName, ApplicationHost, Environment.MachineName, TrackName, and HttpContextToLogMessage(context) (new WebRequestDetails() → Initialize(context) → ToString()) (BR-SE-15)

Origin: ApplicationName/ApplicationHost/TrackName resolution is implemented in Get setting value (SAIF.NetCore.EnvironmentClient) and executed on behalf of this operation. 2. ISaifLogService.Debug(message) writes the built message at Debug level (BR-SE-15)

Origin: Debug-level log emission is implemented in Emit information log entry (SAIF.NetCore.Logging) and executed on behalf of this operation. 3. await next(context) passes control to the rest of the pipeline.

Process flow

This diagram shows the per-request path through this middleware only — from request entry to await next(context) — not the surrounding pipeline stages documented in other operations.

flowchart TD
    Start([Request enters pipeline]) --> S1[Build request-details log message]
    S1 --> S2[ISaifLogService.Debug]
    S2 --> S3[await next]
    S3 --> EndOk([Request continues down the pipeline])

Failure and edge-case behavior

Sources

  • src/SAIF.NetCore.ServiceExtensions/SAIF.NetCore.ServiceExtensions/SAIF.NetCore.ServiceExtensions/Middleware/DebugRequestHandler.cs