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
Installation
Install the NuGet package from nuget.org
Step 1 — Install the package
Add the Serilog.Sinks.Radianz NuGet package to your project:
dotnet add package Serilog.Sinks.RadianzConfiguration
Configure the sink with your Radianz credentials
Quick Start
Configure Serilog with the Radianz HTTP sink. Replace clientId and apiKey with your actual credentials:
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:
builder.Host.UseSerilog((ctx, lc) => lc
.WriteTo.RadianzHttp(
clientId: ctx.Configuration["Radianz:ClientId"],
apiKey: ctx.Configuration["Radianz:ApiKey"])
.WriteTo.Console());clientId is the App's Client ID and your apiKey is the API Token.Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
clientId | string | — | Client ID for authentication (required) |
apiKey | string | — | API key for authentication (required) |
baseUrl | string | https://radianz.io | Base URL of the Radianz instance |
restrictedToMinimumLevel | LogEventLevel | Verbose | Minimum log level to send |
batchSizeLimit | int | 50 | Maximum number of events per batch |
batchPeriod | TimeSpan | 5s | Maximum time before flushing the batch |
queueLimit | int | 10000 | Maximum 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:
.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:
.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:
.WriteTo.RadianzMessageQueue(
connectionString: "Endpoint=sb://your-ns.servicebus.windows.net/;...",
queueName: "radianz-logs")