Arebis.MvcDashboardLogging 8.0.0

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

// Install Arebis.MvcDashboardLogging as a Cake Tool
#tool nuget:?package=Arebis.MvcDashboardLogging&version=8.0.0                

Introduction

This component contains an ASP.NET Core MVC 8 item template consisting of:

  • A DbContext schema for holding request log information in database,
  • Request logging middleware to write failed request information to database,
  • A dashboard to show and manage request log information.

Installation

To install the project item template (to be done once per developer machine):

dotnet new install Arebis.MvcDashboardLogging

To add the package to an ASP.NET Core MVC 8 project, from the project folder:

dotnet new MvcDashboardLogging

Or from the the solution folder:

dotnet new MvcDashboardLogging -n <WebProjectName>

Setup

Once the package added to your project, add following service registrations in Program.cs or Startup.cs:

builder.Services.AddDbContext<MyMvcApp.Data.Logging.LoggingDbContext>(options =>
    options.UseSqlServer(
        builder.Configuration.GetConnectionString("DefaultConnection")));

builder.Services.AddScoped<MyMvcApp.Logging.RequestLogger>();

Next, register the request logging middleware with the following command:

app.UseArebisRequestLog()
    .ApplyDoNotLogRule()
    .LogSlowRequests()
    .LogExceptions()
    .LogNotFounds();

(Where "MyMvcApp" is the project name/namespace of your ASP.NET MVC App.)

Also make sure you have a route registered to handle ASP.NET MVC Areas:

app.MapControllerRoute(
    name: "area",
    pattern: "{area:exists}/{controller=Home}/{action=Index}/{id?}");

This route registration must be added before the default route registration.

Finally, start your ASP.NET MVC application and navigate to /MvcDashboardLogging. Run the database migrations if requested. On the Logs tab you can now find logs for all failed requests.

When using the dashboard, it is adviced to have Output caching configured in your Program.cs. See: https://learn.microsoft.com/en-us/aspnet/core/performance/caching/output?view=aspnetcore-8.0

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • net8.0

    • No dependencies.

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
8.1.5 106 10/12/2024
8.1.4 120 9/16/2024
8.1.1 120 9/16/2024
8.1.0 113 9/11/2024
8.0.0 107 9/10/2024
7.2.0 655 10/26/2023
7.1.0 280 10/19/2023
7.0.0 355 9/8/2023
0.9.1 317 8/9/2023
0.9.0 239 7/3/2023