首页 > 其他 > 详细

uipath 干净整洁的日志

时间:2019-12-16 12:22:47      阅读:173      评论:0      收藏:0      [点我收藏+]

资料贡献的原地址https://forum.uipath.com/t/export-output-logs-automaticly/1480

效果如图

技术分享图片

 

 汉化版:

找到 NLog.Config文件位于UiPath安装文件夹中(通常为C:\ Program Files(x86)\ UiPath Platform

1.
添加变量以仅获取第一条消息

<variable name="truncated_message" value="${replace:replaceWith=...:regex=true:inner=${message}:searchFor=(\,.*$)}"/>

2.将新变量添加到日志布局

layout="${time}${level}${truncated_message}

技术分享图片

 

 觉得复杂的小伙伴可以直接复制下面代码,覆盖到原文件

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<variable name="WorkflowLoggingDirectory" value="${specialfolder:folder=LocalApplicationData}/UiPath/Logs" />
<variable name="truncated_message" value="${replace:replaceWith=...:regex=true:inner=${message}:searchFor=(\,.*$)}" />
<rules>
<logger name="WorkflowLogging" writeTo="WorkflowLogFiles" final="true" />
<logger minLevel="Info" writeTo="EventLog" />
</rules>
<targets>
<target type="File" name="WorkflowLogFiles" fileName="${WorkflowLoggingDirectory}/${shortdate}_Execution.log" layout="${time} ${level} ${truncated_message}" keepFileOpen="true" openFileCacheTimeout="5" concurrentWrites="true" encoding="utf-8" writeBom="true" />
<target type="EventLog" name="EventLog" layout="${processname} ${assembly-version} ${newline}${message}" source="UiPath" log="Application" />
</targets>
</nlog>

uipath 干净整洁的日志

原文:https://www.cnblogs.com/fanqiusha1988/p/12048251.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!