Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit ab13ee25
由
LN
编写于
2021-07-01 10:44:59 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
json日志修改
1 个父辈
8c88b725
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
62 行增加
和
3 行删除
source/ACSingleStore/20210701更新说明.txt
source/ACSingleStore/ACSingleStore.csproj
source/ACSingleStore/记录.txt
source/Common/util/RunLogUtil.cs
source/DeviceLibrary/store/KTK_Store.cs
source/ACSingleStore/20210701更新说明.txt
0 → 100644
查看文件 @
ab13ee2
20210701 增加json日志 打印,需要修改日志配置,ACSingleStoreL.exe文件,把log4net的配置用如下配置覆盖:
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file type="log4net.Util.PatternString" value="logs/Store-%property{fname}.log" />
<param name="Encoding" value="UTF-8" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyy-MM-dd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" />
</layout>
</appender>
<appender name="RunLog" type="log4net.Appender.RollingFileAppender">
<file type="log4net.Util.PatternString" value="logs/log/RunLog-%property{fname}.log" />
<param name="Encoding" value="UTF-8" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyy-MM-dd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value=" %m%n" />
</layout>
</appender>
<!--<root>
<level value="Info" />
<appender-ref ref="RollingLogFileAppender" />
</root>-->
<logger name="RollingLogFileAppender">
<level value="Info" />
<appender-ref ref="RollingLogFileAppender" />
</logger>
<logger name="RunLog">
<level value="Info" />
<appender-ref ref="RunLog" />
</logger>
</log4net>
\ No newline at end of file
source/ACSingleStore/ACSingleStore.csproj
查看文件 @
ab13ee2
...
...
@@ -176,6 +176,7 @@
<EmbeddedResource Include="ServoAxisInfo.resx">
<DependentUpon>ServoAxisInfo.cs</DependentUpon>
</EmbeddedResource>
<Content Include="20210701更新说明.txt" />
<Content Include="Camera.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
...
...
source/ACSingleStore/记录.txt
查看文件 @
ab13ee2
...
...
@@ -68,7 +68,7 @@ StoreConfig.csv需要增加一行配置:
PRO,是否启用仓门口料盘检测信号,IsUse_Door_Check,1,,,,,,,,,,,
20200628 增加json日志 打印,需要修改日志配置:
20200628 增加json日志 打印,需要修改日志配置
,ACSingleStoreL.exe文件,把log4net的配置用如下配置覆盖
:
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
...
...
source/Common/util/RunLogUtil.cs
查看文件 @
ab13ee2
...
...
@@ -65,6 +65,11 @@ namespace OnlineStore.Common
}
public
ErrorLog
(
string
deviceName
,
string
errType
,
string
errMsg
,
DateTime
startTime
,
DateTime
endTime
,
string
operType
=
""
,
string
posid
=
""
,
string
barcode
=
""
)
{
if
(
errType
==
null
)
{
errType
=
""
;
}
if
(
errMsg
==
null
)
{
errMsg
=
""
;
}
if
(
operType
==
null
)
{
operType
=
""
;
}
if
(
posid
==
null
)
{
posid
=
""
;
}
if
(
barcode
==
null
)
{
barcode
=
""
;
}
this
.
LogType
=
"Error"
;
this
.
DeviceName
=
deviceName
.
Trim
();
this
.
ErrorType
=
errType
.
Trim
();
...
...
@@ -109,6 +114,9 @@ namespace OnlineStore.Common
}
public
MoveLog
(
string
deviceName
,
string
moveType
,
string
moveMsg
,
DateTime
startTime
,
DateTime
endTime
,
string
posid
=
""
,
string
barcode
=
""
)
{
if
(
moveMsg
==
null
)
{
moveMsg
=
""
;
}
if
(
posid
==
null
)
{
posid
=
""
;
}
if
(
barcode
==
null
)
{
barcode
=
""
;
}
this
.
LogType
=
"Running"
;
this
.
DeviceName
=
deviceName
.
Replace
(
"-Move"
,
""
).
Replace
(
"-SMove"
,
""
).
Trim
();
this
.
MoveType
=
moveType
.
Trim
();
...
...
@@ -150,6 +158,8 @@ namespace OnlineStore.Common
}
public
InoutEndLog
(
string
deviceName
,
string
moveType
,
DateTime
startTime
,
DateTime
endTime
,
string
posid
=
""
,
string
barcode
=
""
)
{
if
(
posid
==
null
)
{
posid
=
""
;
}
if
(
barcode
==
null
)
{
barcode
=
""
;
}
this
.
LogType
=
"InoutEnd"
;
this
.
DeviceName
=
deviceName
.
Replace
(
"-Move"
,
""
).
Replace
(
"-SMove"
,
""
).
Trim
();
this
.
MoveType
=
moveType
.
Trim
();
...
...
@@ -189,6 +199,9 @@ namespace OnlineStore.Common
}
public
AxisMoveLog
(
string
deviceName
,
string
axisName
,
string
moveType
,
int
targetP
,
int
speed
,
DateTime
startTime
,
DateTime
endTime
,
string
posid
=
""
,
string
barcode
=
""
)
{
if
(
moveType
==
null
)
{
moveType
=
""
;
}
if
(
posid
==
null
)
{
posid
=
""
;
}
if
(
barcode
==
null
)
{
barcode
=
""
;
}
this
.
LogType
=
"Axis"
;
this
.
DeviceName
=
deviceName
.
Replace
(
"-Move"
,
""
).
Replace
(
"-SMove"
,
""
).
Trim
();
this
.
MoveType
=
moveType
.
Trim
();
...
...
source/DeviceLibrary/store/KTK_Store.cs
查看文件 @
ab13ee2
...
...
@@ -507,6 +507,8 @@ namespace OnlineStore.DeviceLibrary
/// <param name="logseconds"></param>
public
void
SetWarnMsg
(
string
msg
=
""
,
string
alarmType
=
""
,
StoreMoveInfo
moveInfo
=
null
,
int
logseconds
=
10
)
{
try
{
int
logtype
=
801
;
if
(
moveInfo
!=
null
)
{
...
...
@@ -514,7 +516,7 @@ namespace OnlineStore.DeviceLibrary
}
if
(
String
.
IsNullOrEmpty
(
msg
).
Equals
(
false
))
{
if
(
WarnMsg
.
Equals
(
msg
))
if
(
WarnMsg
.
Equals
(
msg
)
||
alarmType
.
Equals
(
warnParam
.
AlarmType
))
{
if
(
msg
.
StartsWith
(
StoreName
))
{
...
...
@@ -561,7 +563,11 @@ namespace OnlineStore.DeviceLibrary
warnParam
.
OperteType
=
""
;
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"SetWarnMsg Error: "
+
ex
.
ToString
());
}
WarnMsg
=
msg
;
warnParam
.
AlarmType
=
alarmType
;
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论