예제 #1
0
파일: Loger.cs 프로젝트: neao2002/RS.Core
        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);
            }
        }
예제 #2
0
파일: Loger.cs 프로젝트: neao2002/RS.Core
        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);
            }
        }
예제 #3
0
 /// <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);
 }
예제 #4
0
 /// <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);
 }