UiPath Documentation
automation-suite
2023.4
false
UiPath logo, featuring letters U and I in white
OUT OF SUPPORT

Automation Suite on EKS/AKS installation guide

Last updated Feb 25, 2025

Configuring Log Rules

Overview

Robot logs capture diagnostic and execution logs. You can configure the conditions for which Robot logs are ingested by Insights. For example, you only want to capture logs for Processes that include a specific name.

For more information, see Robot logs.

When to Configure Log Rules

  • After Insights installation.
  • After Insights upgrade.
  • When you want to add or configure existing log rules.

Default Log Rules

The default settings for Robot logs ingested by Insights include Ingest only last logs and error logs. The following sections show default log rules based on the Insights version that you are running.

Default Log Rules for Versions 2022.4 and higher

In this example, the last logs and Error logs for all processes are ingested. This version of Insights ingests the last Info level from a Robot that has executed a process, alongside process and any Error level logs, as shown in the following example.

<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>

Default Log Rules for Version 2021.10

In this example, all logs (Info level and higher) for all processes are ingested. This version of Insights ingests all logs (Info level and and higher) generated by the Robot for all processes, as shown in the following example.

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

Configure Log Rules

You can configure the Orchestrator settings in the nlog.custom.config file. To modify the settings, take the following steps:
  1. Place the new log rules inside the nlog.custom.config file. Check the following details for an example:
    {
      "10_Robot_Insights": {
        "logger": "Robot.*",
        "ruleName": "insightsRobotLogsRule",
        "minLevel": "Info",
        "writeTo": "insightsRobotLogs",
        "enabled": false,
        "final": false,
        "filters": {
          "defaultAction": "Ignore",
          "conditions": [
            {
              "condition": "level >= LogLevel.Error or ends-with('${message}', ' execution ended')",
              "action": "Log"
            }
          ]
        }
      }
    }{
      "10_Robot_Insights": {
        "logger": "Robot.*",
        "ruleName": "insightsRobotLogsRule",
        "minLevel": "Info",
        "writeTo": "insightsRobotLogs",
        "enabled": false,
        "final": false,
        "filters": {
          "defaultAction": "Ignore",
          "conditions": [
            {
              "condition": "level >= LogLevel.Error or ends-with('${message}', ' execution ended')",
              "action": "Log"
            }
          ]
        }
      }
    }
  2. Use the Orchestrator Configurator Tool to update the configuration. Use the following command to merge the keys from the custom nlog.custom.config file with the settings already available in the orchestrator-customconfig configuration map.
     ./orchestrator-configurator.sh -l nlog.custom.config ./orchestrator-configurator.sh -l nlog.custom.config
    This command does not remove any existing settings.

Log Rules Example

In the following example, we are only sending logs that exceed a certain level or contain the message that the execution has ended:

{
  "10_Robot_Insights": {
    "logger": "Robot.*",
    "ruleName": "insightsRobotLogsRule",
    "minLevel": "Info",
    "writeTo": "insightsRobotLogs",
    "enabled": false,
    "final": false,
    "filters": {
      "defaultAction": "Ignore",
      "conditions": [
        {
          "condition": "level >= LogLevel.Error or ends-with('${message}', ' execution ended')",
          "action": "Log"
        }
      ]
    }
  }
}{
  "10_Robot_Insights": {
    "logger": "Robot.*",
    "ruleName": "insightsRobotLogsRule",
    "minLevel": "Info",
    "writeTo": "insightsRobotLogs",
    "enabled": false,
    "final": false,
    "filters": {
      "defaultAction": "Ignore",
      "conditions": [
        {
          "condition": "level >= LogLevel.Error or ends-with('${message}', ' execution ended')",
          "action": "Log"
        }
      ]
    }
  }
}

Ingest All Logs and Any Error Logs for a Particular Process

In the following example, Insights ingests all Info level and Error logs for the following process names: payment disp, 68fields, or 68fields_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>

Ingest Only Last and Error Logs for a Particular Process

In the following example, Insights ingests only last Info level logs and Error logs for the following process names: payment disp, 68fields, or 68fields_20.

Only Error level logs and the last log of each Robot are logged in to 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>

Do Not Ingest Logs for a Particular Process

In the following example, Insights does not ingest any logs for the process name: 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>

Related Articles

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated