Files
Ayay/Ayay.SerilogLogs/LogModules.cs

30 lines
1.6 KiB
C#
Raw Normal View History

2026-01-15 18:56:39 +08:00
namespace Ayay.SerilogLogs
{
/// <summary>
/// 统一管理系统中的日志模块名称SourceContext
/// <para>使用常量可以避免硬编码字符串带来的拼写错误</para>
/// </summary>
public static class LogModules
{
// --- 核心架构层 ---
2026-01-16 07:23:56 +08:00
public static string Core { get; } = "Core"; // 系统主逻辑/启动关闭
public static string Network { get; } = "Network"; // 底层网络通讯 (TCP/UDP)
public static string WebApi { get; } = "WebAPI"; // 对外 HTTP 接口
public static string gRpc { get; } = "gRPC"; // 对外 gRPC 接口
public static string WebSocket { get; } = "WebSocket"; // 实时通讯
public static string Ping { get; } = "Ping"; // 心跳/Ping包 (通常量大且不重要)
2026-01-15 18:56:39 +08:00
// --- 业务逻辑层 ---
2026-01-16 07:23:56 +08:00
public static string UserSystem { get; } = "UserSystem"; // 用户账户/权限系统
public static string UserAction { get; } = "UserAction"; // 用户操作行为 (审计日志)
public static string DeviceOps { get; } = "DeviceOps"; // 设备运行/控制指令
2026-01-15 18:56:39 +08:00
// --- 核心算法层 ---
2026-01-16 07:23:56 +08:00
public static string Algorithm { get; } = "Algorithm"; // 算法分析/AI识别 (需要上下文追踪)
public static string Observation { get; } = "Observation"; // 观察点/埋点 (用于调试或统计)
2026-01-15 18:56:39 +08:00
// --- 第三方集成 ---
2026-01-16 07:23:56 +08:00
public static string HikVisionSdk { get; } = "HikVisionSdk"; // 第三方 SDK 调用封装
2026-01-15 18:56:39 +08:00
}
}