Files
DMS/DMS.Infrastructure/Entities/DbNlog.cs

51 lines
1.4 KiB
C#
Raw Normal View History

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