Logger Web
Overview
VersaTul.Logger.Web implements the shared logger contract by POSTing log payloads to an HTTP endpoint.
It is useful when you want centralized logging through an internal API, webhook, or remote collector while keeping application code dependent only on the common ILogger abstraction.
When To Use This Package
Use this package when you want to:
Send logs to a remote HTTP endpoint.
Emit structured JSON payloads instead of flat text.
Add authentication or payload signing headers.
Prevent repeated failing calls through a simple circuit breaker.
Installation
Install the package with the .NET CLI:
dotnet add package VersaTul.Logger.Web
Or with the Package Manager Console:
PM> NuGet\Install-Package VersaTul.Logger.Web -Version latest
Core Types And Concepts
IWebLoggerandWebLoggerHTTP-backed logger implementation.
ILogWebConfigurationandLogWebConfigurationExpose endpoint, authentication, signing, and circuit-breaker settings.
ILogParserProduces JSON payloads for outbound requests.
Key Capabilities
Sends log data as JSON over HTTP POST.
Supports optional custom auth headers and tokens.
Supports HMAC-based payload signing through
WebhookSigningSecret.Tracks consecutive failures and opens a circuit breaker temporarily when the threshold is exceeded.
Basic Example
using VersaTul.Logger;
using VersaTul.Logger.Contracts;
using VersaTul.Logger.Web;
ILogger logger = new WebLogger(httpClientFactory, webLogConfiguration, new LogParser());
await logger.LogAsync(new LogInfo(LogLevel.Warning, "Imports", "Remote sink latency detected"));
Configuration Notes
ILogWebConfiguration includes:
BaseUrlLogEndPointWebhookAuthHeaderWebhookAuthTokenWebhookSigningSecretCircuitBreakerFailureThresholdCircuitBreakerCooldownSeconds
Notes
WebLoggerthrows when the circuit breaker is open, so callers should decide whether to swallow or surface sink failures.Signing is added through an
X-Webhook-Signatureheader computed from the JSON payload.This package fits centralized operational logging better than local diagnostics.