Ejemplo n.º 1
0
 /// <summary>
 /// 记录程序启动时间
 /// </summary>
 private void RecordApplicationRunTime()
 {
     Task.Run(() =>
     {
         LogWritterFactory.Write("订单通知程序启动", string.Format("订单通知程序启动时间:{0}", GlobalPara.ApplicationStartTime));
     });
 }
Ejemplo n.º 2
0
 static LoanManagementLogger()
 {
     logSysyem = LogWritterFactory.GetLogger("FlatFile");
     logQueue  = new ConcurrentQueue <Tuple <string, int, int, TraceEventType, string> >();
     Task.Factory.StartNew(() =>
     {
         while (true)
         {
             Tuple <string, int, int, TraceEventType, string> logValaue;
             if (logQueue.TryDequeue(out logValaue))
             {
                 logSysyem.Write(logValaue.Item1, logValaue.Item2, logValaue.Item3,
                                 logValaue.Item4, logValaue.Item5);
             }
             else
             {
                 Thread.Sleep(1000); // interval for iteration
             }
         }
     });
 }
Ejemplo n.º 3
0
 private void JobManager_JobException(JobExceptionInfo obj)
 {
     LogWritterFactory.Write("订单通知程序作业异常", string.Format("订单通知程序作业[{0}]异常:原因:{1}", obj.Name, obj.Exception));
 }