Arebis.MvcDashboardLogging 7.2.0

dotnet add package Arebis.MvcDashboardLogging --version 7.2.0
NuGet\Install-Package Arebis.MvcDashboardLogging -Version 7.2.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="7.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Arebis.MvcDashboardLogging --version 7.2.0
#r "nuget: Arebis.MvcDashboardLogging, 7.2.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=7.2.0

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

Introduction

This component contains an ASP.NET Core MVC 7 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 7 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.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • net7.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
7.2.0 484 10/26/2023
7.1.0 235 10/19/2023
7.0.0 309 9/8/2023
0.9.1 278 8/9/2023
0.9.0 207 7/3/2023