示例#1
0
        /// <summary>
        /// 删除一个月前的log
        /// </summary>
        void ClearOverdueLog()
        {
            try
            {
                while (true)
                {
                    if (Signal.IsSystemStoping)
                    {
                        break;
                    }
                    string clearLogTime = "23:00";
                    if (TimeCheckHelper.CheckTime("clearLogTime", clearLogTime))
                    {
                        Common.LogManager.WriteLog(LogFile.Trace, "clear overdue log start");
                        //清理
                        LogTableManager ltm = LogTableManager.Instance;
                        ltm.ClearOverdueLog();
                        Common.LogManager.WriteLog(LogFile.Trace, "clear overdue log end");
                    }

                    System.Threading.Thread.Sleep(1200000);
                }
            }
            catch (Exception ex)
            {
                Common.LogManager.WriteLog(LogFile.System, MessageUtil.GetExceptionMsg(ex, ""));
            }
        }