Uipath log fields details

In the orchestrator logs , for each log there are log fields generated like machine name , workflow name etc

How does UiPath gets the value of these log fields ??

@Ritaman_Baral,

UiPath captures these log fields using a combination of system-level APIs, environment variables, and internal logging mechanisms built into the UiPath Robot and Studio. Here’s how the process works:

  1. Machine Name:

    • Capture Mechanism: The Robot accesses the operating system’s environment variables or makes a system call to retrieve the machine’s hostname. This is typically done using .NET APIs like Environment.MachineName.
  2. Workflow Name:

    • Capture Mechanism: The Robot monitors which XAML file is being executed. It extracts the name of the file (or the main entry XAML in a process) when the workflow starts. This is managed by UiPath’s internal execution tracking mechanism.
  3. Robot Name:

    • Capture Mechanism: When a Robot connects to Orchestrator, it retrieves its configuration, including its name. This name is stored locally within the Robot’s context, allowing it to log the Robot’s identity during execution.
  4. Process Name:

    • Capture Mechanism: The Robot captures the process name from the deployment package metadata. This information is embedded in the package when it is published to Orchestrator and is read by the Robot during execution.
  5. Log Level:

    • Capture Mechanism: The log level is determined at runtime based on either the default settings in Orchestrator, the workflow’s specific logging settings, or the log activity configuration within the workflow.
  6. Transaction ID:

    • Capture Mechanism: If the workflow uses transactions (such as in ReFramework), the Robot generates or retrieves a unique transaction ID each time a transaction is processed. This is managed by the transactional execution model within UiPath.
  7. Timestamp:

    • Capture Mechanism: The timestamp is generated using the system clock at the exact moment the log entry is created. The Robot utilizes .NET’s DateTime.Now or similar functions to capture this.
  8. Message:

    • Capture Mechanism: Log messages are captured based on the execution of specific logging activities (like Log Message, Write Line, etc.). These activities generate log messages at runtime, which are then packaged with the other log information.

Logging Flow:

  • Internal Logging API: UiPath Robot uses an internal logging API that collects all the relevant log fields as the workflow executes.
  • Log Aggregation: These fields are aggregated into a structured log entry.
  • Transmission to Orchestrator: The log entry is then sent to Orchestrator (if connected) or saved locally if not connected.

The Robot performs this logging in real-time as the workflow progresses, ensuring that all relevant context (like machine name, workflow name, etc.) is captured accurately for each log entry.

LLM helped me to write this but it’s accurate as per my knowledge.

Thanks,
Ashok :slightly_smiling_face: