Arebis.MvcDashboardLogging
8.1.5
dotnet add package Arebis.MvcDashboardLogging --version 8.1.5
NuGet\Install-Package Arebis.MvcDashboardLogging -Version 8.1.5
<PackageReference Include="Arebis.MvcDashboardLogging" Version="8.1.5" />
paket add Arebis.MvcDashboardLogging --version 8.1.5
#r "nuget: Arebis.MvcDashboardLogging, 8.1.5"
// Install Arebis.MvcDashboardLogging as a Cake Addin #addin nuget:?package=Arebis.MvcDashboardLogging&version=8.1.5 // Install Arebis.MvcDashboardLogging as a Cake Tool #tool nuget:?package=Arebis.MvcDashboardLogging&version=8.1.5
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
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.