LogFlake.Client.AspNetCore
1.8.4
dotnet add package LogFlake.Client.AspNetCore --version 1.8.4
NuGet\Install-Package LogFlake.Client.AspNetCore -Version 1.8.4
<PackageReference Include="LogFlake.Client.AspNetCore" Version="1.8.4" />
<PackageVersion Include="LogFlake.Client.AspNetCore" Version="1.8.4" />
<PackageReference Include="LogFlake.Client.AspNetCore" />
paket add LogFlake.Client.AspNetCore --version 1.8.4
#r "nuget: LogFlake.Client.AspNetCore, 1.8.4"
#addin nuget:?package=LogFlake.Client.AspNetCore&version=1.8.4
#tool nuget:?package=LogFlake.Client.AspNetCore&version=1.8.4
LogFlake Client ASP.NET Core 
This repository contains the sources for the client-side components of the LogFlake product suite for applications logs and performance collection for ASP.NET applications.
🏠 LogFlake Website | 🔥 CloudPhoenix Website
Downloads
NuGet Package Name | Version | Downloads |
---|---|---|
LogFlake.Client.AspNetCore |
Dependencies
This package depends on LogFlake.Client.NetCore. Please refer to the documentation of that package for usage instructions.
Usage
- [Optional] If you want to customize some automatic logs from the middleware, add the following section to your
secrets.json
file:
"LogFlakeMiddlewareSettings": {
"LogRequest": true,
"LogResponse": true,
"LogNotFoundErrors": true
},
All of them are optional, if a boolean property it's missing, the default value is false
;
- Create a class (name it something like
ConfigureLogFlakeMiddlewareOptions
) that implementsIConfigureOptions<LogFlakeMiddlewareOptions>
and configure each property as preferred:
GlobalExceptionHandler
: This flag let you specify if you want the LogFlakeMiddleware try & catch all the unhandled exceptions in your application. When the flag is set totrue
, thenext
method will be surrounded by a try / catch block. In case of any unhandled exception, theOnError
will be called.OnError
: This function will be called when the middleware encounters a Status Code that is greater or equal to 400, and the Body's response is empty, so you can customize the response depending on the case;GetPerformanceMonitorLabel
: For ASP.NET applications, the performance label should be a string representing the Uri with placeholders for variables instead of actual values. Due some limitations of the .NET Standard framework, theEndpoint
of theHttpContext
cannot be easily accessed inside a Class Library. But you can write your own implementation in order to get a performance label. ℹ️ Suggestion: Use the RoutePattern property of the RouteEndpoint instance taken fromhttpContext.GetEndpoint()
.IgnoreLogProcessing
: This method will be invocated on each invocation of the middleware to understand if the current request has to be logged or not. It's recommended to use theLogFlakeIgnoreAttribute
on the action you want to ignore and check in this method if it's present or not.
- Register your class as a Singleton:
services.AddSingleton<IConfigureOptions<LogFlakeMiddlewareOptions>, ConfigureLogFlakeMiddlewareOptions>();
- After calling
services.AddLogFlake(configuration);
, register LogFlakeMiddleware by adding the following line of code:
services.ConfigureLogFlakeMiddlewareOptions(configuration);
Note: The middleware registration will also require a
CorrelationId
, by default the middleware uses aGuid
. You can customize this behavior passing aCorrelationType
to the method above, you can also choose a TraceIdentifier or a CustomCorrelationId
.
Note: In order to use a Custom
CorrelationId
you must implement and register (as a AddScoped)ICorrelationService
interface. 5. Register the middleware on yourWebApplication
app.UseLogFlakeMiddleware();
- If you need to add more parameter to log entries generated by the Middleware (such as data from Claims), you need to implement
IParameterService
interface and register as a Scoped before theservices.ConfigureLogFlakeMiddlewareOptions(configuration);
invocation.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. 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. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- LogFlake.Client.NetCore (>= 1.8.4)
- Microsoft.AspNetCore.Diagnostics (>= 2.3.0)
- Microsoft.AspNetCore.Http (>= 2.3.0)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
- Microsoft.AspNetCore.Http.Extensions (>= 2.3.0)
- Microsoft.AspNetCore.Http.Features (>= 5.0.17)
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.8.4 | 414 | 20 days ago |
1.8.3 | 1,143 | 5 months ago |
1.8.2 | 98 | 5 months ago |
1.8.1 | 656 | 6 months ago |
1.8.0 | 111 | 6 months ago |
1.7.0 | 151 | 6 months ago |
1.6.1 | 115 | 6 months ago |
1.6.0 | 189 | 8 months ago |
1.5.5 | 378 | 9 months ago |
1.5.4 | 129 | 9 months ago |
1.5.3 | 128 | 10 months ago |
1.5.2 | 120 | 10 months ago |
1.5.1 | 114 | 10 months ago |
1.5.0 | 121 | 10 months ago |