QuackAlert 1.0.3

dotnet add package QuackAlert --version 1.0.3
                    
NuGet\Install-Package QuackAlert -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="QuackAlert" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="QuackAlert" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="QuackAlert" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add QuackAlert --version 1.0.3
                    
#r "nuget: QuackAlert, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package QuackAlert@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=QuackAlert&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=QuackAlert&version=1.0.3
                    
Install as a Cake Tool

quackalert

QuackAlert is a lightweight monitoring and alert library for .NET applications, designed to capture HTTP 5xx errors and send real-time email notifications.

Nuget: https://www.nuget.org/packages/QuackAlert/

✨ Features

  • Automatic HTTP 5xx error capture
  • Simple configuration via Options Pattern
  • Request tracking with duration and timestamp

📦 Installation

dotnet add package QuackAlert

Or via NuGet Package Manager:

Install-Package QuackAlert

🚀 Quick Start

{
  "QuackAlert": {
    "Enabled": true,
    "Environment": "Production",
    "Email": {
      "SmtpHost": "smtp.gmail.com",
      "SmtpPort": 587,
      "SmtpUser": "your-email@gmail.com",
      "SmtpPassword": "your-app-password",
      "From": "your-email@gmail.com",
      "To": "recipient@email.com",
      "EnableSsl": true
    }
  }
}

And in Program.cs:

using QuackAlert.Extensions;
using QuackAlert.Enums;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddQuackAlert(options =>
{
    builder.Configuration.GetSection("QuackAlert").Bind(options);
});

var app = builder.Build();

// Add middleware
app.UseQuackAlert();

app.Run();

2. Configuration from Code

using QuackAlert.Extensions;
using QuackAlert.Enums;

var builder = WebApplication.CreateBuilder(args);

// Add QuackAlert
builder.Services.AddQuackAlert(options =>
{
    options.Enabled = true;
    options.Environment = EnvironmentType.Production;
    
    options.Email.SmtpHost = "smtp.gmail.com";
    options.Email.SmtpPort = 587;
    options.Email.SmtpUser = "your-email@gmail.com";
    options.Email.SmtpPassword = "your-app-password";
    options.Email.From = "your-email@gmail.com";
    options.Email.To = "recipient@email.com";
    options.Email.EnableSsl = true;
});

var app = builder.Build();

// Add middleware
app.UseQuackAlert();

app.Run();

⚙️ Configuration

QuackAlertOptions

Property Type Default Description
Enabled bool true Enables or disables QuackAlert
Environment EnvironmentType Production Sets the environment (Development, Staging, Production)
Email EmailOptions - Email configuration settings

EmailOptions

Property Type Default Description
SmtpHost string "" SMTP server
SmtpPort int 587 SMTP port
SmtpUser string "" SMTP username
SmtpPassword string "" SMTP password
From string "" Sender email address
To string "" Recipient email address
EnableSsl bool true Enables SSL/TLS

Note: Email sending is only activated when Enabled = true AND Environment = Production.

📊 What Gets Captured

QuackAlert automatically monitors:

  • ✅ HTTP response status
  • ✅ Request path
  • ✅ HTTP method (GET, POST, etc.)
  • ✅ Request timestamp
  • ✅ Request duration in milliseconds
  • ✅ Unhandled exceptions

Email Example

When a 5xx error occurs, you'll receive a formatted HTML email containing:

{
  "Timestamp": "2024-12-20T10:30:00Z",
  "Path": "/api/users",
  "Method": "POST",
  "StatusCode": 500,
  "DurationMs": 1250
}

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.0.3 0 12/29/2025