private static void Formatted(string fitex, string format, params object[] args) { string ip = LibHelper.GetClientIP(); DateTime time = DateTime.Now; string logFilex = string.Format("【{0} - {1:yyyy-MM-dd HH:mm:ss,ms} {2}】", fitex, time, ip); if (LogSaveType == 1) { logToTable(ip, GetDomain(), fitex, time, string.Concat(logFilex, string.Format(format, args))); } else { FileUtils.AppendTextFileLine(GetLogFileName(), string.Concat(logFilex, string.Format(format, args)), true); } }
private static void writeLog(string fitex, object message) { string ip = LibHelper.GetClientIP(); DateTime time = DateTime.Now; if (LogSaveType == 1) { logToTable(ip, GetDomain(), fitex, time, string.Concat(message)); } else { string logFilex = string.Format("【{0} - {1:yyyy-MM-dd HH:mm:ss,ms} {2}】", fitex, time, ip); FileUtils.AppendTextFileLine(GetLogFileName(), string.Concat(logFilex, message), true); } }
/// <summary> /// 注册系统日志的类型 /// </summary> /// <param name="TypeConfigKey"></param> /// <param name="SqlConnectstring"></param> /// <param name="LogTableName"></param> /// <param name="dbType"></param> /// <returns></returns> public IAppRegister RegDbLogger(string TypeConfigKey, string SqlConnectstring, string LogTableName, DbDriverType dbType = DbDriverType.SQLServer) { Loger.RegisLogger(LibHelper.GetAppSetting(TypeConfigKey), SqlConnectstring, LogTableName, dbType); return(this); }
/// <summary> /// 注册系统日志的类型 /// </summary> /// <param name="TypeConfigKey"></param> /// <param name="LogPath"></param> /// <returns></returns> public IAppRegister RegLogger(string TypeConfigKey, string LogPath) { Loger.RegisLogger(LibHelper.GetAppSetting(TypeConfigKey), LogPath); return(this); }