TradeWindsLoggerProvider 1.0.0.1
See the version list below for details.
dotnet add package TradeWindsLoggerProvider --version 1.0.0.1
NuGet\Install-Package TradeWindsLoggerProvider -Version 1.0.0.1
<PackageReference Include="TradeWindsLoggerProvider" Version="1.0.0.1" />
paket add TradeWindsLoggerProvider --version 1.0.0.1
#r "nuget: TradeWindsLoggerProvider, 1.0.0.1"
// Install TradeWindsLoggerProvider as a Cake Addin #addin nuget:?package=TradeWindsLoggerProvider&version=1.0.0.1 // Install TradeWindsLoggerProvider as a Cake Tool #tool nuget:?package=TradeWindsLoggerProvider&version=1.0.0.1
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.
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.
License
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.
Product | Versions 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. |
-
net8.0
- Azure.Storage.Blobs (>= 12.22.1)
- Microsoft.Extensions.Logging.Configuration (>= 8.0.0)
- TradeWindsExtensions (>= 1.0.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.