MonitCat.EntityFramework 1.0.9

dotnet add package MonitCat.EntityFramework --version 1.0.9
                    
NuGet\Install-Package MonitCat.EntityFramework -Version 1.0.9
                    
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="MonitCat.EntityFramework" Version="1.0.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MonitCat.EntityFramework" Version="1.0.9" />
                    
Directory.Packages.props
<PackageReference Include="MonitCat.EntityFramework" />
                    
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 MonitCat.EntityFramework --version 1.0.9
                    
#r "nuget: MonitCat.EntityFramework, 1.0.9"
                    
#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.
#:package MonitCat.EntityFramework@1.0.9
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MonitCat.EntityFramework&version=1.0.9
                    
Install as a Cake Addin
#tool nuget:?package=MonitCat.EntityFramework&version=1.0.9
                    
Install as a Cake Tool

MonitCat 监控猫

适用于 .NET 6/7/8/9 等现代 .NET 平台的数据审计与日志监控存储中间件。

介绍

MonitCat 是一个用于 .NET 的轻量级审计与监控库(DotNet Core 数据审计与日志监控存储)。它提供数据审计、操作日志记录、异常与性能监控以及定期数据清理功能,便于在生产环境中追踪与分析应用行为。MonitCat 可与 Entity Framework Core 和 MySQL(通过 Pomelo)无缝集成,适用于 .NET 6/7/8/9 等现代 .NET 平台。主要组件:MonitCat(核心扩展)、MonitCat.EntityFramework(EF 存储实现)。

安装/使用

dotnet add package MonitCat
dotnet add package MonitCat.EntityFramework
dotnet add package Pomelo.EntityFrameworkCore.MySql
执行数据库脚本 Sql/MonitCat.sql

快速入门

  1. 添加数据库链接:
"ConnectionStrings": {
    "ApplicationDbContext": "Server=127.0.0.1;Database=MonitCat;Uid=root;Pwd=123456;AllowLoadLocalInfile=true;"
  }
  1. 引用命名空间:
using MonitCat.Extensions;
using MonitCat.EntityFramework.Extensions;
using Microsoft.EntityFrameworkCore;
  1. 添加MonitCat中间件:

builder.Services.AddMonitCat(options =>
{
    options.Enabled = true;// 是否启用审计数据记录功能
    options.Source = typeof(Program).Assembly.GetName().Name!;
    options.IsAutoClear = true;// 是否自动清理
    options.ClearTimeSchedule = MonitCat.Enums.MonitCatAutoClearScheduleEnum.Daily;
},autoUse:true).AddDefaultStore(options => options.UseMySql(builder.Configuration.GetConnectionString("ApplicationDbContext"), ServerVersion.Parse("8.0.36")));

或

builder.Services.AddMonitCat(options =>
{
    options.Enabled = true;// 是否启用审计数据记录功能
    options.Source = typeof(Program).Assembly.GetName().Name!;
    options.IsAutoClear = true;// 是否自动清理
    options.ClearTimeSchedule = MonitCat.Enums.MonitCatAutoClearScheduleEnum.Daily;
},autoUse:false).AddDefaultStore(options => options.UseMySql(builder.Configuration.GetConnectionString("ApplicationDbContext"), ServerVersion.Parse("8.0.36")));

//var app = builder.Build();

app.UseMonitCat(conf =>
{
    conf.CorsPolicy = "CorsPolicy";
    conf.PageUsername = "admin";
    conf.PagePassword = "123";
    conf.Blacklist = "/,/Home,/Home/Privacy";
});

  1. 监控信息查询:

http://ip:port/catlogin  

许可证

MonitCat 采用 Apache2.0 开源许可证。

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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
1.0.9 112 2/5/2026
1.0.8 110 1/31/2026
1.0.7 109 1/31/2026
1.0.6 105 1/30/2026
1.0.5 107 1/30/2026