Files
XplorePlane/XP.Common/Logging/Configs/SerilogConfig.cs
T

44 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.
using System;
using System.IO;
namespace XP.Common.Logging.Configs
{
/// <summary>
/// Serilog 日志配置实体(从 App.config 读取)| Serilog logging configuration entity (loaded from App.config)
/// </summary>
public class SerilogConfig
{
/// <summary>
/// 日志输出根路径(默认:AppData/Files/Logs| Log output root path (default: AppData/Files/Logs)
/// </summary>
public string LogPath { get; set; } = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"Files", "Logs");
/// <summary>
/// 最低日志级别(Debug/Info/Warn/Error/Fatal| Minimum log level
/// </summary>
public string MinimumLevel { get; set; } = "Info";
/// <summary>
/// 是否输出到控制台(调试环境=true,生产环境=false| Whether to output to console
/// </summary>
public bool EnableConsole { get; set; } = true;
/// <summary>
/// 日志文件分割规则(Day/Month/Hour/Size| Log file rolling interval
/// </summary>
public string RollingInterval { get; set; } = "Day";
/// <summary>
/// 单个日志文件最大大小(MB,仅 Size 分割时生效)| Single log file max size (MB)
/// </summary>
public long FileSizeLimitMB { get; set; } = 100;
/// <summary>
/// 保留日志文件数量(默认30天)| Retained file count limit (default 30)
/// </summary>
public int RetainedFileCountLimit { get; set; } = 30;
}
}