|
@@ -8,10 +8,11 @@ namespace ServiceCenter.Logs
|
|
|
public class LogHub
|
|
|
{
|
|
|
/// <summary>
|
|
|
- /// 发布一条世界交互日志
|
|
|
+ /// 发布世界交互日志
|
|
|
/// </summary>
|
|
|
/// <param name="logs"></param>
|
|
|
- public static void WorldPublish(ConcurrentQueue<KeyLog> logs)
|
|
|
+ /// <param name="World">当前世界</param>
|
|
|
+ public static void WorldPublish(ConcurrentQueue<KeyLog> logs, string World)
|
|
|
{
|
|
|
if (logs.Count > 0)
|
|
|
{
|
|
@@ -28,14 +29,14 @@ namespace ServiceCenter.Logs
|
|
|
}));
|
|
|
}
|
|
|
//存入业务报警内容
|
|
|
- List<BusinessAlarm> businesses = logs.Where(v => v.Log.Level != LogLevelEnum.Low).Select(v => new BusinessAlarm()
|
|
|
+ List<BusinessAlarm> businesses = logs.Where(v => v.Log.Level != LogLevelEnum.Low && v.Log.LogUpLoad == LogUpLoadEnum.UpLoadWMS).Select(v => new BusinessAlarm()
|
|
|
{
|
|
|
BusinessName = v.Channel.System,
|
|
|
DevNo = v.Channel.Item,
|
|
|
Con = v.ToString(),
|
|
|
Time = DateTime.Now
|
|
|
}).ToList();
|
|
|
- RedisHub.WMS.Set($"{nameof(BusinessAlarm)}", JsonConvert.SerializeObject(businesses));
|
|
|
+ RedisHub.WMS.Set($"{nameof(BusinessAlarm)}:{World}", JsonConvert.SerializeObject(businesses));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -54,21 +55,6 @@ namespace ServiceCenter.Logs
|
|
|
}));
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 增加一条处理日志
|
|
|
- /// </summary>
|
|
|
- /// <param name="title">文件名</param>
|
|
|
- /// <param name="con">内容</param>
|
|
|
- public static void InterfaceProcessLog(string title, string con)
|
|
|
- {
|
|
|
- RedisHub.Default.RPush("LogHub", JsonConvert.SerializeObject(new LogModel
|
|
|
- {
|
|
|
- path = $"D:\\WCSLogs\\{DateTime.Now.yyyyMMdd()}\\接口处理日志",
|
|
|
- Title = $"{title}.txt",
|
|
|
- Con = $"{DateTime.Now.yyyyMMddhhmmssf()}--[{Thread.CurrentThread.ManagedThreadId}]--{con}\n"
|
|
|
- }));
|
|
|
- }
|
|
|
-
|
|
|
public static void init()
|
|
|
{
|
|
|
while (true)
|