Serilog Sink Integration

Send structured logs from .NET applications directly to Radianz

Overview

What is the Serilog Sink?

The Serilog.Sinks.Radianz NuGet package is a Serilog sink that sends structured log events directly to the Radianz platform. Logs are batched and sent asynchronously with retry and exponential backoff — zero impact on your application's performance. Supports both HTTP and Azure Service Bus transports.

How it works
Your .NET App
Serilog Sink
Radianz
Async batching (configurable size and period)
Retry with exponential backoff and jitter (Polly)
Full structured logging with properties and scopes
HTTP and Azure Service Bus transports
Multi-target: .NET 8 and .NET 10
Zero impact on application performance

Installation

Install the NuGet package from nuget.org

Step 1 — Install the package

Add the Serilog.Sinks.Radianz NuGet package to your project:

bash
dotnet add package Serilog.Sinks.Radianz
CompatibilityThe package supports .NET 8 and .NET 10 (multi-target). It depends on Serilog 4.x and uses Polly for retry policies.

Configuration

Configure the sink with your Radianz credentials

Quick Start

Configure Serilog with the Radianz HTTP sink. Replace clientId and apiKey with your actual credentials:

C#
using Serilog;
using Serilog.Sinks.Radianz.Extensions;

Log.Logger = new LoggerConfiguration()
    .WriteTo.RadianzHttp(
        clientId: "your-client-id",
        apiKey: "your-api-key")
    .CreateLogger();

Log.Information("Hello from {AppName}!", "MyApp");
ASP.NET Core Integration

For ASP.NET Core applications, use the host builder integration to read credentials from configuration:

C#
builder.Host.UseSerilog((ctx, lc) => lc
    .WriteTo.RadianzHttp(
        clientId: ctx.Configuration["Radianz:ClientId"],
        apiKey: ctx.Configuration["Radianz:ApiKey"])
    .WriteTo.Console());
Where do I find my credentials?Go to Elmah > Log API Tokens in the Radianz dashboard. Your clientId is the App's Client ID and your apiKey is the API Token.
Configuration Options
Option Type Default Description
clientIdstringClient ID for authentication (required)
apiKeystringAPI key for authentication (required)
baseUrlstringhttps://radianz.ioBase URL of the Radianz instance
restrictedToMinimumLevelLogEventLevelVerboseMinimum log level to send
batchSizeLimitint50Maximum number of events per batch
batchPeriodTimeSpan5sMaximum time before flushing the batch
queueLimitint10000Maximum number of events to queue before dropping

Advanced Configuration

Fine-tune batching, retry, and transport options

Custom Batching & Minimum Level

Adjust batch size, period, and minimum log level to control volume and frequency:

C#
.WriteTo.RadianzHttp(
    clientId: "your-client-id",
    apiKey: "your-api-key",
    restrictedToMinimumLevel: LogEventLevel.Warning,
    batchSizeLimit: 100,
    batchPeriod: TimeSpan.FromSeconds(10))
Full Options via Action

For complete control over all settings, use the action-based configuration:

C#
.WriteTo.Radianz(options =>
{
    options.TransportType = RadianzTransportType.Http;
    options.HttpOptions = new HttpTransportOptions
    {
        ClientId = "your-client-id",
        ApiKey   = "your-api-key"
    };
    options.Batching.BatchSizeLimit = 100;
    options.Retry.MaxRetryAttempts  = 5;
})
Azure Service Bus Transport

Instead of sending logs directly over HTTP, you can route them through Azure Service Bus for higher reliability:

C#
.WriteTo.RadianzMessageQueue(
    connectionString: "Endpoint=sb://your-ns.servicebus.windows.net/;...",
    queueName: "radianz-logs")
When to use Service Bus?Use the Azure Service Bus transport when you need guaranteed delivery, your application runs in Azure, or you want to decouple log ingestion from the Radianz backend availability.