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
                    
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="LogFlake.Client.AspNetCore" Version="1.8.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LogFlake.Client.AspNetCore" Version="1.8.4" />
                    
Directory.Packages.props
<PackageReference Include="LogFlake.Client.AspNetCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LogFlake.Client.AspNetCore --version 1.8.4
                    
#r "nuget: LogFlake.Client.AspNetCore, 1.8.4"
                    
#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.
#addin nuget:?package=LogFlake.Client.AspNetCore&version=1.8.4
                    
Install LogFlake.Client.AspNetCore as a Cake Addin
#tool nuget:?package=LogFlake.Client.AspNetCore&version=1.8.4
                    
Install LogFlake.Client.AspNetCore as a Cake Tool

LogFlake Client ASP.NET Core Version

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 NuGet Version NuGet Downloads

Dependencies

This package depends on LogFlake.Client.NetCore. Please refer to the documentation of that package for usage instructions.

Usage

  1. [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;

  1. Create a class (name it something like ConfigureLogFlakeMiddlewareOptions) that implements IConfigureOptions<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 to true, the next method will be surrounded by a try / catch block. In case of any unhandled exception, the OnError 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, the Endpoint of the HttpContext 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 from httpContext.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 the LogFlakeIgnoreAttribute on the action you want to ignore and check in this method if it's present or not.
  1. Register your class as a Singleton:
services.AddSingleton<IConfigureOptions<LogFlakeMiddlewareOptions>, ConfigureLogFlakeMiddlewareOptions>();
  1. 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 a Guid. You can customize this behavior passing a CorrelationType to the method above, you can also choose a TraceIdentifier or a Custom CorrelationId.

Note: In order to use a Custom CorrelationId you must implement and register (as a AddScoped) ICorrelationService interface. 5. Register the middleware on your WebApplication

app.UseLogFlakeMiddleware();
  1. 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 the services.ConfigureLogFlakeMiddlewareOptions(configuration); invocation.
Product 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. 
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.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