Skip to content

.NET logging

  1. Install the NuGet package ErrorNotifier.Extensions.Logging in an ASP.NET Core, console, or worker-service project.
  2. Register the provider with builder.Logging.AddErrorNotifier(). The provider implements ILoggerProvider, ILogger, and ISupportExternalScope.
  3. Set ErrorNotifier:ApiKey or use ERRORNOTIFIER_SERVER_KEY / ERRORNOTIFIER_PROJECT_KEY. Server secret keys should be preferred for trusted backend services; project keys are sent as X-ErrorNotifier-Key.
  4. Keep the default Endpoint at https://errornotifier.com/api/log for hosted ingestion. Free tier usage is intended for one site and limited volume.
  5. Use ERRORNOTIFIER_ENDPOINT for an exact endpoint or ERRORNOTIFIER_BASE_URL to build /wp-json/errornotifier/v1/store for a WordPress receiver.
  6. For Enterprise or high-volume deployments, override Endpoint to your own receiver. The WordPress receiver is /wp-json/error-notifier/v1/log, while the preferred high-volume design is a direct MySQL ingestion gateway.
  7. Log calls never wait for HTTP. They enqueue to a bounded channel and return immediately. Full queues drop oldest entries instead of blocking application code.
  8. The background worker batches logs, posts JSON, retries transient failures with exponential backoff and jitter, then writes failed batches to local fallback files.
  9. Tune BatchSize, QueueSize, FlushInterval, MinimumLogLevel, RetryCount, HttpTimeout, FallbackDirectory, ServiceName, Environment, and Release per environment.
using ErrorNotifier.Extensions.Logging;

var builder = WebApplication.CreateBuilder(args);
builder.Logging.AddErrorNotifier();

// appsettings.json
{
  "ErrorNotifier": {
    "ApiKey": "ensk_xxx",
    "Endpoint": "https://errornotifier.com/api/log",
    "BatchSize": 100,
    "QueueSize": 10000,
    "FlushInterval": "00:00:05",
    "MinimumLogLevel": "Warning"
  }
}

// Environment variables shared with Python examples
ERRORNOTIFIER_SERVER_KEY=ensk_your_server_secret_key
ERRORNOTIFIER_PROJECT_KEY=enpk_your_public_project_key
ERRORNOTIFIER_ENDPOINT=https://errornotifier.com/api/log
ERRORNOTIFIER_BASE_URL=https://errornotifier.com
ERRORNOTIFIER_ENVIRONMENT=production
ERRORNOTIFIER_RELEASE=web-2026.06.09.1
ERRORNOTIFIER_SERVICE_NAME=checkout-api

// Self-hosted WordPress endpoint override
{
  "ErrorNotifier": {
    "Endpoint": "https://logs.example.com/wp-json/error-notifier/v1/log"
  }
}

NuGet download

Download ErrorNotifier.Extensions.Logging.1.0.2.nupkg

Download SHA-256 checksum

Package ID

ErrorNotifier.Extensions.Logging

Pin version 1.0.2 in production and mirror the package into your organization feed when needed.

Install command

dotnet add package ErrorNotifier.Extensions.Logging --version 1.0.2

For local package installs, use the downloaded package with a local NuGet source folder.

Hosted

Use the default endpoint when one application or site fits hosted plan limits and you want ErrorNotifier to manage ingestion, storage, and retention.

Enterprise

Use a higher-volume ErrorNotifier plan for multiple sites, larger teams, and managed ingestion capacity, or set a custom endpoint for self-hosting.

Backend options

The WordPress endpoint stores logs in a custom table for convenient self-hosting. Direct MySQL ingestion is preferred for sustained high volume because it avoids WordPress request bootstrap overhead and supports partition-based retention.

Python connection parity

The public Python connection guide and the .NET NuGet package use one environment-variable contract. That means a mixed Python/.NET estate can set the same project key, endpoint, environment, release, and service-name variables in deployment manifests, CI secrets, or container settings.

Open Python connection guide

VariableRequired for.NET behaviorPython parity
ERRORNOTIFIER_SERVER_KEYTrusted backend .NET servicesSent as Authorization: Bearer.Same variable is supported by Python backend examples.
ERRORNOTIFIER_PROJECT_KEYProject-key based .NET log ingestionSent as X-ErrorNotifier-Key when the value starts with enpk_.Same variable is the normal Python site error-event key.
ERRORNOTIFIER_ENDPOINTExact receiver endpointOverrides the hosted /api/log endpoint.Same variable overrides Python /store ingestion.
ERRORNOTIFIER_BASE_URLWordPress receiver base URLBuilds /wp-json/errornotifier/v1/store when ERRORNOTIFIER_ENDPOINT is absent.Same variable builds the Python store endpoint.
ERRORNOTIFIER_ENVIRONMENTEnvironment taggingPopulates ErrorNotifier:Environment when explicit config is absent.Same variable tags Python events.
ERRORNOTIFIER_RELEASERelease correlationPopulates ErrorNotifier:Release when explicit config is absent.Same variable tags Python releases.
ERRORNOTIFIER_SERVICE_NAMEService taggingPopulates ErrorNotifier:ServiceName when explicit config is absent.Same variable tags Python services.

Public demo

Review the real product screens with read-only mock data

Open the demo workspace to inspect monitors, incidents, domains, alert channels, status pages, projects, issues, automated test runs, releases, artifacts, audit history, and umbrella reports without creating an account.