Insights
2022.10
False
  • 发行说明
      • 2022.10.1
      • 2022.10.2
      • 2022.10.3
      • 2022.10.4
      • 2022.10.5
      • 2022.10.6
      • 2022.10.7
      • 2022.10.8
    • 用户迁移工具发行说明
  • 入门指南
  • 访问和权限
  • 安装和升级
  • 与 Insights 交互
  • 历史数据导出
  • 日志
    • 配置日志规则
    • 日志收集器
  • 性能和可扩展性
横幅背景图像
Insights
上次更新日期 2024年3月20日

配置日志规则

概述

机器人日志可捕获诊断日志和执行日志。您可以配置 Insights 用于提取机器人日志的条件。例如,您只想捕获包含特定名称的流程的日志。

有关更多信息,请参阅机器人日志

何时配置日志规则

  • 安装 Insights 后。
  • 升级 Insights 后。
  • 当您要添加或配置现有日志规则时。

默认日志规则

Insights 用于提取的机器人日志的默认设置包括“仅提取最新日志和错误日志”。以下部分显示的内容为您正在运行的 Insights 版本所用的默认日志规则。

2022.4 版及更高版本的默认日志规则

在此示例中,系统会提取所有流程的最新日志和错误日志。此版本的 Insights 从已执行流程的机器人中提取最新的 Info 级别的日志,以及流程和 Error 级别的日志,如以下示例所示。

<logger name="Robot.*" ruleName="insightsRobotLogsRule" enabled="true" minlevel="Info" writeTo="insightsRobotLogs">
        <filters defaultAction="Ignore">
          <when condition="level &gt;= LogLevel.Error or ends-with('${message}',' execution ended')" action="Log" />
          <when condition="'${ui-robot-logs-num-custom-fields}' &gt; 1 and not ends-with('${message}', ' execution started')" action="Log" />
        </filters><logger name="Robot.*" ruleName="insightsRobotLogsRule" enabled="true" minlevel="Info" writeTo="insightsRobotLogs">
        <filters defaultAction="Ignore">
          <when condition="level &gt;= LogLevel.Error or ends-with('${message}',' execution ended')" action="Log" />
          <when condition="'${ui-robot-logs-num-custom-fields}' &gt; 1 and not ends-with('${message}', ' execution started')" action="Log" />
        </filters>

版本 2021.10 的默认日志规则

在此示例中,提取所有流程的所有日志(Info 级别及更高级别)。此版本的 Insights 会提取机器人为所有流程生成的所有日志(Info 级别及更高级别),如以下示例所示。

<logger name="Robot.*" ruleName="insightsRobotLogsRule" enabled="true" minlevel="Info" writeTo="insightsRobotLogs"/><logger name="Robot.*" ruleName="insightsRobotLogsRule" enabled="true" minlevel="Info" writeTo="insightsRobotLogs"/>

配置日志规则

备注:
  • 只有管理员才能更改 Orchestrator 配置文件中的值。
  • 在继续之前备份 UiPath.Orchestrator.dll.config 文件。您可以在 C:\Program Files (x86)\UiPath\Orchestrator 中找到该文件。
  • 更改 Orchestrator 配置文件后重新启动网站。
  • 所有参数都区分大小写。
  • 为获得最佳性能,两年内生成的机器人日志不应超过 2 亿条记录。
  • 使用 NLog 配置文件在您的环境中捕获与 Insights 相关的数据,并减少机器人日志生成的记录数量。
  1. 导航到 C:\Program Files (x86)UiPath\Orchestrator,然后打开 UiPath.Orchestrator.dll.config 文件以修改 Orchestrator 设置。
  2. 查找“机器人日志”参数(例如 <logger name="Robot.*" environmentSpecificConfiguration/>
  3. 使用默认操作配置筛选条件(例如 filters defaultAction="Ignore")。
  4. 根据日志级别或其他事件配置条件(请参阅日志规则示例)。
  5. 保存文件并重新启动 Orchestrator。

有关配置 Orchestrator 配置文件的更多信息,请参阅 UiPath.Orchestrator.dll.config

日志规则示例

以下示例显示了 Info 和 Error 级别日志的自定义日志规则配置。通过设置特定条件,Insights 将仅针对您配置的流程提取日志。

提取特定流程的所有日志和任何错误日志

在以下示例中,Insights 会针对下列流程,提取所有 Info 级别和 Error 级别的日志:payment disp68fields68fields_20
<logger name="Robot.*" ruleName="insightsRobotLogsRule" enabled="true" minlevel="Info" writeTo="insightsRobotLogs">
    <filters defaultAction="Ignore">
      <when condition="equals('${event-properties:item=processName}', 'payment disp') or equals('${event-properties:item=processName}', '68fields') or equals('${event-properties:item=processName}', '68fields_20')" action="Log" />
    </filters>
  </logger><logger name="Robot.*" ruleName="insightsRobotLogsRule" enabled="true" minlevel="Info" writeTo="insightsRobotLogs">
    <filters defaultAction="Ignore">
      <when condition="equals('${event-properties:item=processName}', 'payment disp') or equals('${event-properties:item=processName}', '68fields') or equals('${event-properties:item=processName}', '68fields_20')" action="Log" />
    </filters>
  </logger>

仅提取特定流程的最新日志和错误日志

在以下示例中,Insights 仅会针对下列流程,提取最新的 Info 级别日志和 Error 级别日志:payment disp68fields68fields_20

系统仅会将每个机器人的 Error 级别的日志和最新日志记录到 Insights。

<logger name="Robot.*" ruleName="insightsRobotLogsRule" enabled="true" minlevel="Info" writeTo="insightsRobotLogs">
    <filters defaultAction="Ignore">
      <when condition="(level >= LogLevel.Error or ends-with('${message}',' execution ended')) and (contains('${event-properties:item=processName}', 'payment disp') or equals('${event-properties:item=processName}', '68fields') or equals('${event-properties:item=processName}', '68fields_20'))" action="Log" />
    </filters>
  </logger><logger name="Robot.*" ruleName="insightsRobotLogsRule" enabled="true" minlevel="Info" writeTo="insightsRobotLogs">
    <filters defaultAction="Ignore">
      <when condition="(level >= LogLevel.Error or ends-with('${message}',' execution ended')) and (contains('${event-properties:item=processName}', 'payment disp') or equals('${event-properties:item=processName}', '68fields') or equals('${event-properties:item=processName}', '68fields_20'))" action="Log" />
    </filters>
  </logger>

不要提取特定流程的日志

在以下示例中,Insights 不会为名为 payment disp 的流程提取任何日志。
<logger name="Robot.*" ruleName="insightsRobotLogsRule" enabled="true" minlevel="Info" writeTo="insightsRobotLogs">
    <filters defaultAction="Log">
      <when condition="equals('${event-properties:item=processName}', 'payment disp')" action="Ignore" />
    </filters>
  </logger><logger name="Robot.*" ruleName="insightsRobotLogsRule" enabled="true" minlevel="Info" writeTo="insightsRobotLogs">
    <filters defaultAction="Log">
      <when condition="equals('${event-properties:item=processName}', 'payment disp')" action="Ignore" />
    </filters>
  </logger>

相关文章

此页面是否有帮助?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath 白色徽标
信任与安全
© 2005-2024 UiPath. All rights reserved.