Files
Ayay/Ayay.SerilogLogs/LogModules.cs
2026-01-16 07:23:56 +08:00

30 lines
1.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
namespace Ayay.SerilogLogs
{
/// <summary>
/// 统一管理系统中的日志模块名称SourceContext
/// <para>使用常量可以避免硬编码字符串带来的拼写错误</para>
/// </summary>
public static class LogModules
{
// --- 核心架构层 ---
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包 (通常量大且不重要)
// --- 业务逻辑层 ---
public static string UserSystem { get; } = "UserSystem"; // 用户账户/权限系统
public static string UserAction { get; } = "UserAction"; // 用户操作行为 (审计日志)
public static string DeviceOps { get; } = "DeviceOps"; // 设备运行/控制指令
// --- 核心算法层 ---
public static string Algorithm { get; } = "Algorithm"; // 算法分析/AI识别 (需要上下文追踪)
public static string Observation { get; } = "Observation"; // 观察点/埋点 (用于调试或统计)
// --- 第三方集成 ---
public static string HikVisionSdk { get; } = "HikVisionSdk"; // 第三方 SDK 调用封装
}
}