Serilog.Sinks.Zulip
1.0.6
dotnet add package Serilog.Sinks.Zulip --version 1.0.6
NuGet\Install-Package Serilog.Sinks.Zulip -Version 1.0.6
<PackageReference Include="Serilog.Sinks.Zulip" Version="1.0.6" />
<PackageVersion Include="Serilog.Sinks.Zulip" Version="1.0.6" />
<PackageReference Include="Serilog.Sinks.Zulip" />
paket add Serilog.Sinks.Zulip --version 1.0.6
#r "nuget: Serilog.Sinks.Zulip, 1.0.6"
#:package Serilog.Sinks.Zulip@1.0.6
#addin nuget:?package=Serilog.Sinks.Zulip&version=1.0.6
#tool nuget:?package=Serilog.Sinks.Zulip&version=1.0.6
Serilog.Sinks.Zulip
![]()
A high-performance, batched asynchronous Serilog sink for the Zulip messaging platform.
Overview
This library provides a production-grade integration for routing structured logs into Zulip channels. It is designed to be non-blocking and network-efficient, ensuring that logging telemetry does not impact application latency.
For more information on the underlying REST API, please refer to the official Zulip API Documentation.
Installation
dotnet add package Serilog.Sinks.Zulip
Configuration Options
The sink can be customized using the ZulipSinkOptions object (or mapped directly from appsettings.json).
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
| ServerUrl | string |
Yes | - | The base URL of your Zulip server (e.g., https://your-org.zulipchat.com). |
| BotEmail | string |
Yes | - | The email address of the bot user sending the logs. |
| ApiKey | string |
Yes | - | The API key generated for the bot user in Zulip. |
| Channel | string |
Yes | "general" |
The channel (stream) ID or name where logs will be routed. |
| DefaultTopic | string? |
No | Log Level | The topic under which messages will be grouped. If left null, logs are grouped by their LogEventLevel (e.g., "Error", "Warning"). |
💡 Tip: In Zulip, topics are a powerful way to thread and organize messages within a channel. To learn more about how they work, check out the official Introduction to Topics guide.
Advanced Batching & Formatting Options
When configuring via the extension methods, you also have access to standard Serilog batching and formatting controls:
| Parameter | Type | Default | Description |
|---|---|---|---|
| restrictedToMinimumLevel | LogEventLevel |
Debug |
The minimum log level required to trigger a Zulip message. |
| batchSizeLimit | int |
50 |
The maximum number of log events sent in a single HTTP request. |
| periodSeconds | int |
2 |
The time to wait between batch transmissions. |
| outputTemplate | string |
Standard Serilog | Customize the markdown layout of the message sent to Zulip. |
Usage Examples
Approach 1: appsettings.json (Recommended)
This library fully supports Serilog.Settings.Configuration. Using appsettings.json prevents hardcoding API keys into your source code.
{
"Serilog": {
"Using": [ "Serilog.Sinks.Zulip" ],
"MinimumLevel": "Information",
"WriteTo": [
{
"Name": "Zulip",
"Args": {
"serverUrl": "[https://your-org.zulipchat.com](https://your-org.zulipchat.com)",
"botEmail": "log-bot@your-org.zulipchat.com",
"apiKey": "YOUR_ZULIP_API_KEY",
"channel": "backend-alerts",
"defaultTopic": "Production Errors",
"restrictedToMinimumLevel": "Warning",
"outputTemplate": "**[{Level}]** {Message:lj}{NewLine}{Exception}"
}
}
]
}
}
Approach 2: C# Fluent Configuration
If you prefer to configure Serilog via code, you can pass options directly during startup.
using Serilog;
using Serilog.Sinks.Zulip;
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Information()
.WriteTo.Zulip(
serverUrl: "[https://your-org.zulipchat.com](https://your-org.zulipchat.com)",
botEmail: "log-bot@your-org.zulipchat.com",
apiKey: "YOUR_ZULIP_API_KEY",
channel: "backend-alerts",
defaultTopic: "Production Errors",
restrictedToMinimumLevel: Serilog.Events.LogEventLevel.Warning
)
.CreateLogger();
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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 is compatible. 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 Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Serilog (>= 4.3.1)
- Serilog.Sinks.PeriodicBatching (>= 5.0.0)
-
net10.0
- Serilog (>= 4.3.1)
- Serilog.Sinks.PeriodicBatching (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.