using System.IO; namespace EntrustSettle.Common.LogHelper; public class LogContextStatic { static LogContextStatic() { if (!Directory.Exists(BaseLogs)) { Directory.CreateDirectory(BaseLogs); } } public const string BaseLogs = "Logs"; public const string BasePathLogs = @"Logs"; public const string LogSource = "LogSource"; public const string AopSql = "AopSql"; public const string SqlOutToConsole = "OutToConsole"; public const string SqlOutToFile = "SqlOutToFile"; public const string OutToDb = "OutToDb"; public const string SugarActionType = "SugarActionType"; public static readonly string FileMessageTemplate = "{NewLine}Date:{Timestamp:yyyy-MM-dd HH:mm:ss.fff}{NewLine}LogLevel:{Level}{NewLine}Message:{Message}{NewLine}{Exception}" + new string('-', 100); public static string Combine(string path1) { return Path.Combine(BaseLogs, path1); } public static string Combine(string path1, string path2) { return Path.Combine(BaseLogs, path1, path2); } public static string Combine(string path1, string path2, string path3) { return Path.Combine(BaseLogs, path1, path2, path3); } }