|
@@ -2,6 +2,7 @@
|
|
|
using ServiceCenter.Extensions;
|
|
|
using ServiceCenter.Redis;
|
|
|
using System.Collections.Concurrent;
|
|
|
+using WCS.Core;
|
|
|
|
|
|
namespace ServiceCenter
|
|
|
{
|
|
@@ -48,10 +49,17 @@ namespace ServiceCenter
|
|
|
while (true)
|
|
|
{
|
|
|
var log = JsonConvert.DeserializeObject<LogModel>(RedisHub.Default.LPop("LogHub"));
|
|
|
- if (log != null)
|
|
|
+ try
|
|
|
{
|
|
|
- if (!Directory.Exists(log.path)) Directory.CreateDirectory(log.path);
|
|
|
- File.AppendAllText(Path.Combine(log.path, log.Title), log.Con);
|
|
|
+ if (log != null)
|
|
|
+ {
|
|
|
+ if (!Directory.Exists(log.path)) Directory.CreateDirectory(log.path);
|
|
|
+ File.AppendAllText(Path.Combine(log.path, log.Title), log.Con);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ File.AppendAllText(Path.Combine($"D:\\WCSLogs\\{DateTime.Now.yyyyMMdd()}\\日志处理进程", "Error.txt"), $"{JsonConvert.SerializeObject(log)}--{ex.Message}--{ex.StackTrace}\n");
|
|
|
}
|
|
|
}
|
|
|
}
|