|
|
|
@ -48,7 +48,7 @@ namespace CoreAgent.Infrastructure.Services.Network |
|
|
|
try |
|
|
|
{ |
|
|
|
_logger.LogDebug("开始处理协议日志,数量: {LogCount}", logCount); |
|
|
|
|
|
|
|
string RuntimeCode = _context.GetNeConfigKey(); |
|
|
|
// 将 CoreAgent.ProtocolClient 的 TransferProtocolLog 转换为 WebSocket 传输层的 MessageTransferProtocolLog
|
|
|
|
var webSocketLogs = logList.Select(log => new MessageTransferProtocolLog |
|
|
|
{ |
|
|
|
@ -65,7 +65,7 @@ namespace CoreAgent.Infrastructure.Services.Network |
|
|
|
Info = log.Info, |
|
|
|
Message = log.Message, |
|
|
|
DeviceCode = _context.DeviceCode, |
|
|
|
RuntimeCode = _context.GetNeConfigKey(), |
|
|
|
RuntimeCode = RuntimeCode, |
|
|
|
|
|
|
|
}); |
|
|
|
ProtocolMessage message = new ProtocolMessage(webSocketLogs.ToArray()); |
|
|
|
@ -75,13 +75,13 @@ namespace CoreAgent.Infrastructure.Services.Network |
|
|
|
|
|
|
|
if (writeSuccess) |
|
|
|
{ |
|
|
|
_logger.LogDebug("协议日志处理成功,数量: {LogCount}, 处理时间: {ProcessingTime}ms", |
|
|
|
logCount, processingTime.TotalMilliseconds); |
|
|
|
_logger.LogDebug("运行编码{RuntimeCode} 协议日志处理成功,数量: {LogCount}, 处理时间: {ProcessingTime}ms", |
|
|
|
RuntimeCode, logCount, processingTime.TotalMilliseconds); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
_logger.LogWarning("协议日志写入通道失败,数量: {LogCount}, 处理时间: {ProcessingTime}ms, 通道可能已满或已关闭", |
|
|
|
logCount, processingTime.TotalMilliseconds); |
|
|
|
_logger.LogWarning("运行编码{RuntimeCode} 协议日志写入通道失败,数量: {LogCount}, 处理时间: {ProcessingTime}ms, 通道可能已满或已关闭", |
|
|
|
RuntimeCode, logCount, processingTime.TotalMilliseconds); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
|