A .NET 8.0 library that provides Discord webhook logging capabilities for .NET applications using the Microsoft.Extensions.Logging framework.
Inspired by https://github.com/ithr0n/DiscordLogging
Add Discord logging to your application's service collection:
// Program.cs or Startup.cs
using DiscordLogger;
// Configure your Discord webhook URL and other options directly
builder.Logging.AddDiscord(options =>
{
options.WebhookUrl = "https://discord.com/api/webhooks/your-webhook";
});
// OR bind to a configuration section
builder.Logging.AddDiscord(builder.Configuration.GetSection("Logging:Discord"));All available config options can be found in DiscordLoggerOptions.cs.
Configure the Discord logger options in appsettings.json:
{
"Logging": {
"Discord": {
"WebhookUrl": "https://discord.com/api/webhooks/your-webhook",
"MinLogLevel": "Information"
}
}
}This project is licensed under the MIT License.