private Log() { if (AppConfigs.IsLogEnabled) { if (WebLog == null) { engine = new CommonEngine(); string appPath = string.Empty; if (!string.IsNullOrEmpty(AppConfigs.LogPath)) appPath = AppConfigs.LogPath; else appPath = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "logs"); DirectoryInfo di = new DirectoryInfo(appPath); if (!di.Exists) di.Create(); string fileName = AppConfigs.ApplicationName + "_" + engine.GetDateSuffix("") + ".log"; FileInfo fi = new FileInfo(Path.Combine(appPath, fileName)); if (fi.Exists) tw = File.AppendText(fi.FullName); else tw = new StreamWriter(fi.FullName); sb = new StringBuilder(); HasError = false; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)