uBeac.Web.Logging.MongoDB 0.43.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package uBeac.Web.Logging.MongoDB --version 0.43.2                
NuGet\Install-Package uBeac.Web.Logging.MongoDB -Version 0.43.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="uBeac.Web.Logging.MongoDB" Version="0.43.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add uBeac.Web.Logging.MongoDB --version 0.43.2                
#r "nuget: uBeac.Web.Logging.MongoDB, 0.43.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 uBeac.Web.Logging.MongoDB as a Cake Addin
#addin nuget:?package=uBeac.Web.Logging.MongoDB&version=0.43.2

// Install uBeac.Web.Logging.MongoDB as a Cake Tool
#tool nuget:?package=uBeac.Web.Logging.MongoDB&version=0.43.2                

HTTP ( Request / Response ) Logging in MongoDB

uBeac.Web.Logging provides a middleware to log HTTP requests/responses and uBeac.Web.Logging.MongoDB provides a repository to store logs to MongoDB.


Getting Started

Install the package with NuGet:

dotnet add package uBeac.Web.Logging.MongoDB

Or:

Install-Package uBeac.Web.Logging.MongoDB

Usage

Just put the following code in Program.cs:

builder.Services.AddMongoDbHttpLogging(builder.Configuration.GetInstance<HttpLoggingMongoDbOptions>("HttpLogging"));

app.UseHttpLoggingMiddleware();

And in appsettings.json:

{
  "HttpLogging": {
    "HttpLog2xxConnectionString": "mongodb://localhost:27017/uBeac-Identity-Template-Http-Logging",
    "HttpLog2xxCollectionName": "HttpLog-2xx",
    "HttpLog4xxConnectionString": "mongodb://localhost:27017/uBeac-Identity-Template-Http-Logging",
    "HttpLog4xxCollectionName": "HttpLog-4xx",
    "HttpLog5xxConnectionString": "mongodb://localhost:27017/uBeac-Identity-Template-Http-Logging",
    "HttpLog5xxCollectionName": "HttpLog-5xx"
  }
}

NOTE:

  • HTTP logs with response status code 100 to 399 are stored in 2xx database and collection.
  • HTTP logs with response status code 400 to 499 are stored in 4xx database and collection.
  • HTTP logs with response status code 500 to 599 are stored in 5xx database and collection.

The following scenarios can be implemented:

  • Store all logs in a database and collection: In this scenario, all connection strings and collection names must be the same
  • Store all logs in a database and multiple collections: In this scenario, all connection strings are the same but the collection names are different
  • Store all logs in multiple databases: In this scenario, all connection strings are different

Product 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. 
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
0.43.14 516 10/21/2022
0.43.13 508 8/15/2022
0.43.12 481 7/20/2022
0.43.11 499 6/23/2022
0.43.10 447 6/23/2022
0.43.9 459 6/22/2022
0.43.8 463 6/22/2022
0.43.7 460 6/22/2022
0.43.6 449 5/29/2022
0.43.5 430 5/18/2022
0.43.4 443 5/18/2022
0.43.3 446 5/18/2022
0.43.2 429 5/13/2022
0.43.1 417 5/8/2022