diff --git a/SlnMesnac.RfidUpload.Analysis/InstructionAdapter.cs b/SlnMesnac.RfidUpload.Analysis/InstructionAdapter.cs index bafa69a..2d037d9 100644 --- a/SlnMesnac.RfidUpload.Analysis/InstructionAdapter.cs +++ b/SlnMesnac.RfidUpload.Analysis/InstructionAdapter.cs @@ -35,7 +35,7 @@ namespace SlnMesnac.RfidUpload.Analysis /// public InstructionInfo ParseInstruction(byte[] buffer) { - logger.Info("开始解析标签信息"); + byte[] m_length = new byte[2]; Array.Copy(buffer, 2, m_length, 0, 2); int bufferLength = Convert.ToInt32(BitConverter.ToString(m_length).Replace("-", ""), 16); diff --git a/SlnMesnac.RfidUpload.Business/CsbHandleBusiness.cs b/SlnMesnac.RfidUpload.Business/CsbHandleBusiness.cs index dca016a..5bace73 100644 --- a/SlnMesnac.RfidUpload.Business/CsbHandleBusiness.cs +++ b/SlnMesnac.RfidUpload.Business/CsbHandleBusiness.cs @@ -93,7 +93,7 @@ namespace SlnMesnac.RfidUpload.Business string jsonString = jsonObject.ToString(); var str = webApiClientApp.UploadAsync(jsonString, "容器指定封发扫描接口"); CsbResult res = JsonConvert.DeserializeObject(str); - logHelper.Info($"容器指定封发扫描接口返回信息:{jsonChange.ModeToJson(res)}"); + } catch (Exception ex) { diff --git a/SlnMesnac.RfidUpload.NLog/LogHelper.cs b/SlnMesnac.RfidUpload.NLog/LogHelper.cs index f3a126c..5165039 100644 --- a/SlnMesnac.RfidUpload.NLog/LogHelper.cs +++ b/SlnMesnac.RfidUpload.NLog/LogHelper.cs @@ -49,7 +49,6 @@ namespace SlnMesnac.RfidUpload.NLog /// 记录Info日志 /// /// - /// public void Info(string msg) { if (loginfo.IsInfoEnabled) @@ -58,11 +57,11 @@ namespace SlnMesnac.RfidUpload.NLog } } - + /// /// 记录Error日志 /// - /// + /// /// public void Error(string info, Exception? ex = null) { diff --git a/SlnMesnac.RfidUpload.NLog/log4net.config b/SlnMesnac.RfidUpload.NLog/log4net.config index 33ab07c..86b90ce 100644 --- a/SlnMesnac.RfidUpload.NLog/log4net.config +++ b/SlnMesnac.RfidUpload.NLog/log4net.config @@ -18,35 +18,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -55,10 +27,10 @@ - + - + @@ -73,81 +45,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/SlnMesnac.RfidUpload.TouchSocket/WebApiClientApp.cs b/SlnMesnac.RfidUpload.TouchSocket/WebApiClientApp.cs index 66a80a2..b59cd94 100644 --- a/SlnMesnac.RfidUpload.TouchSocket/WebApiClientApp.cs +++ b/SlnMesnac.RfidUpload.TouchSocket/WebApiClientApp.cs @@ -57,19 +57,19 @@ namespace SlnMesnac.RfidUpload.TouchSocket var str = jsonChange.ModeToJson(param); - logger.Info(" "); + logger.Info($"==========={reqName}==========="); - logger.Info($"Http请求的:[{guid}] => {str}"); - logger.Info($"Http请求ParamStr的:[{guid}] => {paramStr}"); + logger.Info($"Http请求的:[{guid}] => \r\n {str}"); + logger.Info($"Http请求ParamStr的:[{guid}] => \r\n {paramStr}"); result = client.PostJson(appConfig.localUrl, param); - logger.Info($"Http返回的:[{guid}] => {result}"); + logger.Info($"Http返回的:[{guid}] => \r\n {result}"); } catch (Exception e) { Console.WriteLine(e.Message); result = e.Message; - logger.Info($"请求CSB接口调用服务异常:{e.Message}"); + logger.Info($"[{reqName}]请求CSB接口调用服务异常:{e.Message}"); } return result; } @@ -97,19 +97,19 @@ namespace SlnMesnac.RfidUpload.TouchSocket }; var str = jsonChange.ModeToJson(container); - logger.Info(" "); + logger.Info($"==========={reqName}==========="); - logger.Info($"Http请求的:[{reqName}]:[{guid}] => {str}"); - logger.Info($"Http请求ParamStr的:[{reqName}]:[{guid}] => {paramStr}"); + logger.Info($"Http请求的:[{reqName}]:[{guid}] => \r\n {str}"); + logger.Info($"Http请求ParamStr的:[{reqName}]:[{guid}] => \r\n {paramStr}"); result = client.PostJson(appConfig.localUrl, container); - logger.Info($"Http返回的:[{reqName}]:[{guid}] => {result}"); + logger.Info($"Http返回的:[{reqName}]:[{guid}] => \r\n {result}"); } catch (Exception e) { Console.WriteLine(e.Message); result = e.Message; - logger.Info($"请求CSB接口调用服务异常:{e.Message}"); + logger.Info($"[{reqName}]请求CSB接口调用服务异常:{e.Message}"); } return result; } @@ -126,17 +126,17 @@ namespace SlnMesnac.RfidUpload.TouchSocket string result = string.Empty; try { - logger.Info(" "); + logger.Info($"==========={reqName}==========="); - logger.Info($"Http请求的:[{reqName}]:[{guid}] => {paramStr}"); + logger.Info($"Http请求的:[{reqName}]:[{guid}] => \r\n {paramStr}"); result = client.PostJson(appConfig.localUrl, paramStr); - logger.Info($"Http返回的:[{reqName}]:[{guid}] => {result}"); + logger.Info($"Http返回的:[{reqName}]:[{guid}] => \r\n{result}"); } catch (Exception e) { Console.WriteLine(e.Message); result = e.Message; - logger.Info($"请求CSB接口调用服务异常:{e.Message}"); + logger.Info($"[{reqName}]请求CSB接口调用服务异常:{e.Message}"); } return result; } diff --git a/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs b/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs index 0843b15..5a8513a 100644 --- a/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs +++ b/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs @@ -238,7 +238,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel containerStorageQueryByCsbViewModel.RefreshSubmitVerifyEvent += RefreshSubmitVerify; TransferOrderViewModel.RefreshSubmitVerifyEvent += RefreshSubmitVerify; SelectRouterWindow.RefreshSubmitVerifyEvent += RefreshSubmitVerify; - logger.Info("初始化启动"); + logger.Info("程序启动"); EmptyFilesCommand = new RelayCommand(EmptyFiles); ExportFilesCommand = new RelayCommand(ExportFiles); OpenSerialPortCommand = new RelayCommand(OpenSerialPort);