TradeWindsLoggerProvider 1.0.0.2

dotnet add package TradeWindsLoggerProvider --version 1.0.0.2                
NuGet\Install-Package TradeWindsLoggerProvider -Version 1.0.0.2                
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="TradeWindsLoggerProvider" Version="1.0.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TradeWindsLoggerProvider --version 1.0.0.2                
#r "nuget: TradeWindsLoggerProvider, 1.0.0.2"                
#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.
// Install TradeWindsLoggerProvider as a Cake Addin
#addin nuget:?package=TradeWindsLoggerProvider&version=1.0.0.2

// Install TradeWindsLoggerProvider as a Cake Tool
#tool nuget:?package=TradeWindsLoggerProvider&version=1.0.0.2                

TradeWindsLoggerProvider

We are using this as our logging mechanism for our web app (along with the default Microsoft logging providers such as to Application Insights). It works well for us. But there are sophisticated alternatives out there that might be better for you.

Here is why we ended up with this. We started with Serilog but it had (may be fixed now) a serious bug where it crashed our entire web app when we added the Azure BLOB sink. We spent 3 days trying to figure out what the issue was, and then gave up. (I reported the issue and one of the contributors replied that Blazor was not a supported system for their sink.)

So I created this. If you face the same problem, or for some other reason, need a basic simple LoggerProvider, here it is. It writes to File and Blob. It is in use and is fast and has very little overhead.

This is under the MIT license. If you find this very useful I ask (not a requirement) that you consider reading my book I DON’T KNOW WHAT I’M DOING!: How a Programmer Became a Successful Startup CEO.

And if you like it, please review it on Amazon and/or GoodReads. The number of legitimate reviews helps a lot. Much appreciated.

Mapping configuration to your LoggerProvider

The magic is the ProviderAlias:

[ProviderAlias("Blob")]
public class BlobLoggerProvider : LoggerProviderBase

Unit Tests

I have no idea how to write unit tests for a LoggerProvider as it's all part of the ASP.NET system. If you do, please add that to this project.

We did test this thoroughly. But the testing was as part of our web app, including stepping through in places with the debugger.

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. 
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.0.2 91 10/3/2024
1.0.0.1 105 10/1/2024