Serilog.Sinks.Discord.Tadeucci
1.3.0
dotnet add package Serilog.Sinks.Discord.Tadeucci --version 1.3.0
NuGet\Install-Package Serilog.Sinks.Discord.Tadeucci -Version 1.3.0
<PackageReference Include="Serilog.Sinks.Discord.Tadeucci" Version="1.3.0" />
<PackageVersion Include="Serilog.Sinks.Discord.Tadeucci" Version="1.3.0" />
<PackageReference Include="Serilog.Sinks.Discord.Tadeucci" />
paket add Serilog.Sinks.Discord.Tadeucci --version 1.3.0
#r "nuget: Serilog.Sinks.Discord.Tadeucci, 1.3.0"
#:package Serilog.Sinks.Discord.Tadeucci@1.3.0
#addin nuget:?package=Serilog.Sinks.Discord.Tadeucci&version=1.3.0
#tool nuget:?package=Serilog.Sinks.Discord.Tadeucci&version=1.3.0
This fork changes:
- Updated to .NET 8;
- Applied the following PR's:
- Removed package
Discord.Net.Webhook
so it doesn't use Newtonsoft.Json anymore;
Serilog.Sinks.Discord
Writes Serilog events to a given Discord Channel.
Installation
Install-Package Serilog.Sinks.Discord
Note that a Discord Webhook is required in order to configure the sink, if you don't know how the create a Webhook please refer to the official documentation.
Configuration
Available Log Levels
- Verbose
- Debug
- Information
- Warning
- Error
In Code Configuration
To configure the Serilog sink for Discord, add the following section to your LoggerConfiguration:
Log.Logger = new LoggerConfiguration()
.WriteTo.Discord({WebhookId}, {WebhookToken}, {LogEventLevel.LogLevel}, {botName}, {avatarURL}, {Properties})
.CreateLogger();
Optoinal fields
- LogLevel: Must be specified in the format "LogEventLevel.Debug/Warning/etc." Defaults to "Debug" if not provided.
- botName: If not in use, set to "null". Note: If
avatarURL
is set,botName
is required. - avatarURL
- Properties: Additional properties to include in the log message.
App Settings Configuration
To configure the Serilog sink for Discord, add the following section to your appsettings.json:
{
"Serilog": {
"Using": [
"Serilog.Sinks.Discord"
],
"WriteTo": [
{
"Name": "Discord",
"Args": {
"webhookId": "YOUR_DISCORD_WEBHOOK_ID",
"webhookToken": "YOUR_DISCORD_WEBHOOK_TOKEN",
"botName": "OPTIONAL_BOT_NAME",
"avatarURL": "OPTIONAL_AVATAR_URL",
"minimumLevel": "LOG_LEVEL",
"Properties": {
"Property1": "Value1",
"Property2": "Value2"
}
}
}
]
}
}
Configuration Details:
- webhookId: The ID of the Discord webhook. (Required)
- webhookToken: The token of the Discord webhook. (Required)
- botName: The name under which the log messages will be sent. If left empty or not provided, no name will be displayed.
- avatarURL: URL pointing to an avatar image for the bot. If left empty or not provided, no avatar will be displayed.
- minimumLevel: Minimum log level required for messages to be sent to Discord. (e.g., "Debug", "Information")
- Properties: Additional properties to include in the log message. This can be used to add custom fields to the log messages sent to Discord.
Note: Remember to replace placeholders (YOUR_DISCORD_WEBHOOK_ID, YOUR_DISCORD_WEBHOOK_TOKEN, etc.) with actual values when integrating this into your project.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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 was computed. 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. |
-
net8.0
- Serilog (>= 4.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.3.0 | 376 | 6/8/2025 |