using System; using System.IO; namespace XP.Common.Configs { /// /// Serilog日志配置实体(从App.config读取) /// public class SerilogConfig { /// /// 日志输出根路径(默认:AppData/Files/Logs) /// public string LogPath { get; set; } = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Files", "Logs"); /// /// 最低日志级别(Debug/Info/Warn/Error/Fatal) /// public string MinimumLevel { get; set; } = "Info"; /// /// 是否输出到控制台(调试环境=true,生产环境=false) /// public bool EnableConsole { get; set; } = true; /// /// 日志文件分割规则(Day/Month/Hour/Size) /// public string RollingInterval { get; set; } = "Day"; /// /// 单个日志文件最大大小(MB,仅Size分割时生效) /// public long FileSizeLimitMB { get; set; } = 100; /// /// 保留日志文件数量(默认30天) /// public int RetainedFileCountLimit { get; set; } = 30; } }