2025-06-23 13:42:02 +08:00
|
|
|
|
using SqlSugar;
|
2025-07-21 14:35:17 +08:00
|
|
|
|
using System;
|
2025-06-23 13:42:02 +08:00
|
|
|
|
|
2025-07-18 22:21:16 +08:00
|
|
|
|
namespace DMS.Infrastructure.Entities;
|
2025-06-23 13:42:02 +08:00
|
|
|
|
|
2025-07-03 13:17:25 +08:00
|
|
|
|
/// <summary>
|
2025-07-21 14:35:17 +08:00
|
|
|
|
/// 数据库实体:对应数据库中的 Logs 表,用于存储应用程序日志。
|
2025-07-03 13:17:25 +08:00
|
|
|
|
/// </summary>
|
2025-06-23 13:42:02 +08:00
|
|
|
|
public class DbNlog
|
|
|
|
|
|
{
|
2025-07-21 14:35:17 +08:00
|
|
|
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
|
|
|
|
|
public long Id { get; set; }
|
2025-07-03 13:17:25 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-07-21 14:35:17 +08:00
|
|
|
|
/// 日志记录的时间戳。
|
2025-07-03 13:17:25 +08:00
|
|
|
|
/// </summary>
|
2025-07-21 14:35:17 +08:00
|
|
|
|
public DateTime Logged { get; set; }
|
2025-07-03 13:17:25 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-07-21 14:35:17 +08:00
|
|
|
|
/// 日志级别 (e.g., "Info", "Warn", "Error", "Debug")。
|
2025-07-03 13:17:25 +08:00
|
|
|
|
/// </summary>
|
2025-06-23 13:42:02 +08:00
|
|
|
|
public string Level { get; set; }
|
2025-06-23 17:01:06 +08:00
|
|
|
|
|
2025-07-03 13:17:25 +08:00
|
|
|
|
/// <summary>
|
2025-07-21 14:35:17 +08:00
|
|
|
|
/// 日志消息主体。
|
2025-07-03 13:17:25 +08:00
|
|
|
|
/// </summary>
|
2025-07-21 14:35:17 +08:00
|
|
|
|
[SugarColumn(Length = -1)] // 映射为NVARCHAR(MAX)或类似类型
|
2025-06-23 13:42:02 +08:00
|
|
|
|
public string Message { get; set; }
|
|
|
|
|
|
|
2025-07-03 13:17:25 +08:00
|
|
|
|
/// <summary>
|
2025-07-21 14:35:17 +08:00
|
|
|
|
/// 异常信息,包括堆栈跟踪。如果无异常则为null。
|
2025-07-03 13:17:25 +08:00
|
|
|
|
/// </summary>
|
2025-07-21 14:35:17 +08:00
|
|
|
|
[SugarColumn(IsNullable = true, Length = -1)]
|
|
|
|
|
|
public string Exception { get; set; }
|
2025-07-03 13:17:25 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-07-21 14:35:17 +08:00
|
|
|
|
/// 记录日志的调用点信息 (文件路径:行号)。
|
2025-07-03 13:17:25 +08:00
|
|
|
|
/// </summary>
|
2025-07-21 14:35:17 +08:00
|
|
|
|
public string CallSite { get; set; }
|
2025-07-06 14:20:56 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-07-21 14:35:17 +08:00
|
|
|
|
/// 记录日志的方法名。
|
2025-07-06 14:20:56 +08:00
|
|
|
|
/// </summary>
|
2025-07-21 14:35:17 +08:00
|
|
|
|
public string MethodName { get; set; }
|
|
|
|
|
|
|
2025-07-06 14:20:56 +08:00
|
|
|
|
/// <summary>
|
2025-07-21 14:35:17 +08:00
|
|
|
|
/// (用于聚合) 此条日志在指定时间窗口内被触发的总次数。默认为1。
|
2025-07-06 14:20:56 +08:00
|
|
|
|
/// </summary>
|
2025-07-21 14:35:17 +08:00
|
|
|
|
public int AggregatedCount { get; set; } = 1;
|
2025-06-23 13:42:02 +08:00
|
|
|
|
}
|