master
nodyang@aliyun.com 1 month ago
parent 19b4a751f0
commit f470cf5364

@ -35,7 +35,7 @@ namespace SlnMesnac.RfidUpload.Analysis
/// <exception cref="ArgumentException"></exception>
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);

@ -93,7 +93,7 @@ namespace SlnMesnac.RfidUpload.Business
string jsonString = jsonObject.ToString();
var str = webApiClientApp.UploadAsync(jsonString, "容器指定封发扫描接口");
CsbResult res = JsonConvert.DeserializeObject<CsbResult>(str);
logHelper.Info($"容器指定封发扫描接口返回信息:{jsonChange.ModeToJson(res)}");
}
catch (Exception ex)
{

@ -49,7 +49,6 @@ namespace SlnMesnac.RfidUpload.NLog
/// 记录Info日志
/// </summary>
/// <param name="msg"></param>
/// <param name="ex"></param>
public void Info(string msg)
{
if (loginfo.IsInfoEnabled)
@ -58,11 +57,11 @@ namespace SlnMesnac.RfidUpload.NLog
}
}
/// <summary>
/// 记录Error日志
/// </summary>
/// <param name="errorMsg"></param>
/// <param name="info"></param>
/// <param name="ex"></param>
public void Error(string info, Exception? ex = null)
{

@ -18,35 +18,7 @@
<appender-ref ref="InfoAppender" />
</logger>
<!--PLC日志类-->
<logger name="plclog">
<level value="ALL" />
<appender-ref ref="PlcAppender" />
</logger>
<!--RFID日志类-->
<logger name="rfidlog">
<level value="ALL" />
<appender-ref ref="RfidAppender" />
</logger>
<!--RFID日志类-->
<logger name="viewlog">
<level value="ALL" />
<appender-ref ref="ViewAppender" />
</logger>
<!--Sql日志类-->
<logger name="sqllog">
<level value="ALL" />
<appender-ref ref="SqlAppender" />
</logger>
<!--信号量日志类-->
<logger name="semaphorelog">
<level value="ALL" />
<appender-ref ref="SemaphoreAppender" />
</logger>
<!--错误日志附加介质-->
<appender name="ErrorAppender" type="log4net.Appender.RollingFileAppender">
@ -55,10 +27,10 @@
<param name="MaxSizeRollBackups" value="100" />
<param name="MaxFileSize" value="10240" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"LogError.html"'/>
<param name="DatePattern" value='yyyy-MM-dd/"LogError.txt"'/>
<param name="RollingStyle" value="Date" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;HR COLOR=red&gt;%n异常时间%d [%t] &lt;BR&gt;%n异常级别%-5p &lt;BR&gt;%n异 常 类:%c [%x] &lt;BR&gt;%n%m &lt;BR&gt;%n &lt;HR Size=1&gt;" />
<param name="ConversionPattern" value="%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
</layout>
</appender>
@ -73,81 +45,8 @@
<param name="RollingStyle" value="Date" />
<!--信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
</layout>
</appender>
<!--PLC日志附加介质-->
<appender name="PlcAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\" />
<param name="AppendToFile" value="true" />
<param name="MaxFileSize" value="10240" />
<param name="MaxSizeRollBackups" value="100" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"PlcLog.txt"' />
<param name="RollingStyle" value="Date" />
<!--信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
</layout>
</appender>
<!--Rfid日志附加介质-->
<appender name="RfidAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\" />
<param name="AppendToFile" value="true" />
<param name="MaxFileSize" value="10240" />
<param name="MaxSizeRollBackups" value="100" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"RfidLog.txt"' />
<param name="RollingStyle" value="Date" />
<!--信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
</layout>
</appender>
<appender name="ViewAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\" />
<param name="AppendToFile" value="true" />
<param name="MaxFileSize" value="10240" />
<param name="MaxSizeRollBackups" value="100" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"ViewLog.txt"' />
<param name="RollingStyle" value="Date" />
<!--信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
<param name="ConversionPattern" value="%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
</layout>
</appender>
<appender name="SqlAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\" />
<param name="AppendToFile" value="true" />
<param name="MaxFileSize" value="10240" />
<param name="MaxSizeRollBackups" value="100" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"SqlLog.txt"' />
<param name="RollingStyle" value="Date" />
<!--信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
</layout>
</appender>
<appender name="SemaphoreAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\" />
<param name="AppendToFile" value="true" />
<param name="MaxFileSize" value="10240" />
<param name="MaxSizeRollBackups" value="100" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value='yyyy-MM-dd/"SemaphoreLog.txt"' />
<param name="RollingStyle" value="Date" />
<!--信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间%d [%t] %n日志级别%-5p %n日志内容%m %n " />
</layout>
</appender>
</log4net>
</configuration>

@ -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;
}

@ -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);

Loading…
Cancel
Save