Voyager.Common.Proxy.Diagnostics
1.7.7
See the version list below for details.
dotnet add package Voyager.Common.Proxy.Diagnostics --version 1.7.7
NuGet\Install-Package Voyager.Common.Proxy.Diagnostics -Version 1.7.7
<PackageReference Include="Voyager.Common.Proxy.Diagnostics" Version="1.7.7" />
<PackageVersion Include="Voyager.Common.Proxy.Diagnostics" Version="1.7.7" />
<PackageReference Include="Voyager.Common.Proxy.Diagnostics" />
paket add Voyager.Common.Proxy.Diagnostics --version 1.7.7
#r "nuget: Voyager.Common.Proxy.Diagnostics, 1.7.7"
#:package Voyager.Common.Proxy.Diagnostics@1.7.7
#addin nuget:?package=Voyager.Common.Proxy.Diagnostics&version=1.7.7
#tool nuget:?package=Voyager.Common.Proxy.Diagnostics&version=1.7.7
Voyager.Common.Proxy.Diagnostics
Diagnostics handlers for Voyager.Common.Proxy. Provides two built-in IProxyDiagnostics implementations for logging proxy operations.
Installation
dotnet add package Voyager.Common.Proxy.Diagnostics
Usage
LoggingProxyDiagnostics (via ILogger)
Uses Microsoft.Extensions.Logging with structured message templates. Works with any ILogger provider (Console, Serilog, NLog, etc.).
services.AddLogging(builder => builder.AddConsole());
services.AddProxyLoggingDiagnostics();
services.AddServiceProxy<IUserService>("https://api.example.com");
ConsoleProxyDiagnostics (direct Console.WriteLine)
Writes directly to Console.WriteLine using string interpolation. No dependency on any logging framework - useful for quick debugging or environments without a configured logging provider.
services.AddProxyConsoleDiagnostics();
services.AddServiceProxy<IUserService>("https://api.example.com");
User context (optional)
services.AddProxyRequestContext<HttpContextRequestContext>();
Log Output
The handler produces structured logs with W3C Trace Context fields for distributed tracing:
Request Starting (Debug)
Proxy request starting: GET /users/123 [IUserService.GetUserAsync] TraceId=abc123def456789012345678901234ab SpanId=1234567890abcdef ParentSpanId=(root) User=jan.kowalski Unit=12345/Agent
Request Completed - Success (Debug)
Proxy request completed: GET /users/123 200 in 45ms [IUserService.GetUserAsync] TraceId=abc123... SpanId=1234... ParentSpanId=(root) User=jan.kowalski Unit=12345/Agent
Request Completed - Failure (Warning)
Proxy request failed: GET /users/123 404 in 30ms [IUserService.GetUserAsync] Error=NotFound: User not found TraceId=abc123... SpanId=1234... ParentSpanId=(root) User=jan.kowalski Unit=12345/Agent
Request Exception (Error)
Proxy request exception: GET /users/123 in 5000ms [IUserService.GetUserAsync] Exception=HttpRequestException: Connection refused TraceId=abc123... SpanId=1234... ParentSpanId=(root) User=jan.kowalski Unit=12345/Agent
Retry Attempt (Warning)
Proxy retry attempt 1/3 for [IUserService.GetUserAsync] after Timeout: Request timed out. Waiting 1000ms. TraceId=abc123... SpanId=1234... ParentSpanId=(root) User=jan.kowalski Unit=12345/Agent
Circuit Breaker State Changed (Warning/Information)
Circuit breaker OPENED for IUserService: Closed -> Open. Failures=5. LastError=Unavailable: Connection refused User=jan.kowalski Unit=12345/Agent
W3C Trace Context
All diagnostic events include W3C Trace Context fields:
| Field | Description |
|---|---|
TraceId |
32-character hex ID for the entire trace (spans multiple services) |
SpanId |
16-character hex ID for this specific operation |
ParentSpanId |
16-character hex ID of the parent span (null for root spans) |
When Activity.Current is available (e.g., with OpenTelemetry), trace context is automatically captured. Otherwise, new IDs are generated.
User Context
To include user information in logs, implement IProxyRequestContext:
public class HttpContextRequestContext : IProxyRequestContext
{
private readonly IHttpContextAccessor _httpContextAccessor;
public HttpContextRequestContext(IHttpContextAccessor httpContextAccessor)
{
_httpContextAccessor = httpContextAccessor;
}
public string? UserLogin => _httpContextAccessor.HttpContext?.User?.Identity?.Name;
public string? UnitId => _httpContextAccessor.HttpContext?.User?.FindFirst("unit_id")?.Value;
public string? UnitType => "Agent";
public IReadOnlyDictionary<string, string>? CustomProperties => null;
}
// Register
services.AddHttpContextAccessor();
services.AddProxyRequestContext<HttpContextRequestContext>();
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
- Voyager.Common.Proxy.Abstractions (>= 1.7.7)
-
net6.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
- Voyager.Common.Proxy.Abstractions (>= 1.7.7)
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
- Voyager.Common.Proxy.Abstractions (>= 1.7.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.8.0-preview | 57 | 2/10/2026 |
| 1.7.8-preview.1 | 36 | 2/9/2026 |
| 1.7.7 | 84 | 2/6/2026 |
| 1.7.7-preview.1.1 | 37 | 2/6/2026 |
| 1.7.7-preview | 59 | 2/10/2026 |