WatchDog.SDK
0.1.0-alpha
Prefix Reserved
dotnet add package WatchDog.SDK --version 0.1.0-alpha
NuGet\Install-Package WatchDog.SDK -Version 0.1.0-alpha
<PackageReference Include="WatchDog.SDK" Version="0.1.0-alpha" />
paket add WatchDog.SDK --version 0.1.0-alpha
#r "nuget: WatchDog.SDK, 0.1.0-alpha"
// Install WatchDog.SDK as a Cake Addin #addin nuget:?package=WatchDog.SDK&version=0.1.0-alpha&prerelease // Install WatchDog.SDK as a Cake Tool #tool nuget:?package=WatchDog.SDK&version=0.1.0-alpha&prerelease
WatchDog
Introduction
WatchDog is a real-time cloud-based monitoring, logging, security and alert solutions for software applications.
Support
- .NET Core 3.1 and newer
Installation
Install via .NET CLI
dotnet add package WatchDog.SDK --version 1.0.0
Install via Package Manager
Install-Package WatchDog.SDK --version 1.0.0
Usage
Use the WatchDog middleware as shown below:
Add WatchDog Namespace in Startup.cs
for .NET 3.1 and below and in Program.cs
for .NET 5 and above
using WatchDog;
For .NET 3.1 and below, register WatchDog in Startup.cs
under ConfigureService()
services.AddWatchDog(config =>
{
config.AppID = "YOUR-APP-ID";
config.AppKey = "YOUR-APP-KEY";
config.Blacklist = "password, token, clientSecret";
});
For .NET 5 and above, in Program.cs
builder.Services.AddWatchDog(config =>
{
config.AppID = "YOUR-APP-ID";
config.AppKey = "YOUR-APP-KEY";
config.Blacklist = "password, token, clientSecret";
});
Add WatchDog middleware to the HTTP request pipeline
For .NET 3.1 and below
Startup.cs
underConfigure()
For .NET 5 and aboveProgram.cs
app.UseWatchDog();
Logging
_logger.LogEvent("Testing Event Logging", true, "xTCZ", data: JsonSerializer.Serialize(Summaries), metadata: "Metadata Stuff");
_logger.LogIncident("Severe Incident", IncidentSeverity.Critical);
_logger.LogException(ex);
_logger.LogInformation($"Response: {JsonSerializer.Serialize(result)}");
_logger.LogDebug("..DEBUG..");
_logger.LogTrace("..TRACE..");
_logger.LogError("..ERROR..");
_logger.LogCritical("..CRITICAL..");
_logger.LogWarning("..WARNING..");
Sink Logs from ILogger
You can also sink logs from the .NET ILogger into WatchDog
For .NET 5 and above
builder.Logging.AddWatchDogLogger();
For .NET Core 3.1 and below, configure logging and add .AddWatchDogLogger()
to the builder creation method of the Program.cs
class
Host.CreateDefaultBuilder(args)
.ConfigureLogging( logging =>
{
logging.AddWatchDogLogger();
})
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
Enjoy!
Copyright
Copyright (c) 2024 WatchDogHQ https://www.watchdoghq.co
Documentation
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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 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. |
.NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Logging (>= 6.0.0)
- Microsoft.IO.RecyclableMemoryStream (>= 2.3.2)
- Newtonsoft.Json (>= 13.0.3)
-
net6.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Logging (>= 6.0.0)
- Microsoft.IO.RecyclableMemoryStream (>= 2.3.2)
- Newtonsoft.Json (>= 13.0.3)
-
net7.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Logging (>= 6.0.0)
- Microsoft.IO.RecyclableMemoryStream (>= 2.3.2)
- Newtonsoft.Json (>= 13.0.3)
-
net8.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Logging (>= 6.0.0)
- Microsoft.IO.RecyclableMemoryStream (>= 2.3.2)
- Newtonsoft.Json (>= 13.0.3)
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 |
---|---|---|
0.1.0-alpha | 64 | 1/29/2024 |