DDev.Tooling.ObjectManipulation
1.0.0
See the version list below for details.
dotnet add package DDev.Tooling.ObjectManipulation --version 1.0.0
NuGet\Install-Package DDev.Tooling.ObjectManipulation -Version 1.0.0
<PackageReference Include="DDev.Tooling.ObjectManipulation" Version="1.0.0" />
paket add DDev.Tooling.ObjectManipulation --version 1.0.0
#r "nuget: DDev.Tooling.ObjectManipulation, 1.0.0"
// Install DDev.Tooling.ObjectManipulation as a Cake Addin #addin nuget:?package=DDev.Tooling.ObjectManipulation&version=1.0.0 // Install DDev.Tooling.ObjectManipulation as a Cake Tool #tool nuget:?package=DDev.Tooling.ObjectManipulation&version=1.0.0
DDev.Tooling.LoggerExtensions.Email
What is this package?
DDev.Tooling.LoggerExtensions.Email allows you to easily setup an ILogger in your service container which will then send log outputs to email accounts, depending on their LogLevel defined within AppSettings.json.
Each email is formatted with colours depending on the LogLevel and titled accordingly. If an exception exists in the Log then this will also be output to the email, along with the Message, EventId, Application Name and Logger Category.
How do I use this package?
Install the package using Nuget into your project.
Within your 'Program.cs' add a using statement to include 'DDev.Tooling.LoggerExtensions.Email'
/Program.cs
using DDev.Tooling.LoggerExtensions.Email;
- Add the EmailLogger as a new logging provider.
/Program.cs
var builder = WebApplication.CreateBuilder(args);
builder.Logging.ClearProviders();
builder.Logging.AddEmailLogger();
- Edit AppSettings.json to include your configuration.
/AppSettings.json
{
"Logging": {
"EmailLogger": {
"LogLevels": [
"Warning",
"Critical"
],
"SendAs": "Alerts@domain.net",
"Hostname": "mx1.domain.net",
"Username": "Username",
"Password": "Password",
"UseTLS": true,
"Port": 25,
"AlertRecipients": [
"Recipient1@domain.net",
"Recipient2@domain.net"
],
"UseConsoleLogging": false
}
}
}
Special Considerations
The Email Logger will react based upon the following logic.
if (Hostname is not defined) => Send Email using the recipients' MX record.
else if (Hostname is defined) {
if (Username and Password is not defined) => Send Email without any authentication.
else => Send email with 'AUTH LOGIN' basic authentication.
}
Logging and debugging.
When 'UseConsoleLogging' is set to 'true' within the AppSettings.json file, the logger will log the exception messages to the console window with 'Console.WriteLine()' allowing you to debug why an email will not send.
Tips
If you find any tools within here helpful, consider buying me a beer - I'd appreciate it.
Change Log
1.0.0 → Initial Publish
1.0.1 → Resolved Typo's, Added Markdown README's
1.0.2 → Updated Email Template (This will change), removed the reliance on 'ARSoft.Tools.Net'
1.0.3 → Updated Email as colours were not being automatically changed.
1.0.4 → Email updated once more, previous email did not display in Outlook nicely.
1.0.5 → Re-read code, cleaned up and ensured no errors. Final version unless there are bugs.
1.0.6 → Fixed but where every time you'd have an exception, unable to connect to MX records.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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 was computed. 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 was computed. 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. |
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.