Skip to content

A .NET 8.0 library that provides Discord webhook logging capabilities for .NET applications using the Microsoft.Extensions.Logging framework.

License

Notifications You must be signed in to change notification settings

TheKiiiing/DiscordLogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Logger

NuGet

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

Setup

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"));

Configuration

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"
    }
  }
}

License

This project is licensed under the MIT License.

About

A .NET 8.0 library that provides Discord webhook logging capabilities for .NET applications using the Microsoft.Extensions.Logging framework.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages