# Managing robot logs

> Set Robot log levels in Assistant or Orchestrator and configure log file archiving and deletion using NLog.config to control disk space usage.

## Setting the logging level

You can change the log level via:

* the **Log Level** setting in **Assistant** &gt; **Preferences** &gt; **General** page. By default, it is set to **Information**. For the Service Mode Robot, you need administrator permissions.
* the **Logging Level** setting in **Orchestrator** &gt; **Manage Access** &gt; **Users** &gt; user or robot account &gt; **Robot Settings** page. By default, it is set to **Information**.
  :::note
  The log level you set in Orchestrator overrides the level configured in Assistant.
  :::

## Deleting log files

:::important
Starting with Robot version 2025.10.1, the Robot keeps the 30 most recent daily execution log files and deletes older ones.
:::

To prevent disk space usage, you can choose to archive log files after they reach a specific count. Configure your logging files in the `NLog.config` file, under the `<target>` section, as follows:

* By adding the properties `archiveNumbering="Date"` and `archiveEvery="Day"`, you instruct the system to archive log files on a daily basis, with each archive named by the date.
* The property `archiveDateFormat="yyyy-MM-dd"` sets the format for the dates in the archive file names.
* With `archiveFileName="${WorkflowLoggingDirectory}/{#}_Execution.log"`, you specify the location and format for the archived file names.
* The `maxArchiveFiles="30"` property sets a limit to only keep the 30 most recent archived log files.

:::note
A Robot update resets the `NLog.config` file, removing your edits. Apply them again after each update.
:::

For example:

```
<?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" />
  <rules>
    <logger name="WorkflowLogging" writeTo="WorkflowLogFiles" final="true" />
  </rules>
  <targets>
    <target type="File"
      name="WorkflowLogFiles"
      fileName="${WorkflowLoggingDirectory}/${shortdate}_Execution.log"
      layout="${time} ${level} ${message}"
      keepFileOpen="true"
      openFileCacheTimeout="5"
      concurrentWrites="true"
      encoding="utf-8"
      writeBom="true"
      archiveNumbering="Date"
      archiveEvery="Day"
      archiveDateFormat="yyyy-MM-dd"
      archiveFileName="${WorkflowLoggingDirectory}/{#}_Execution.log"
      maxArchiveFiles="30"
    />
  </targets>
</nlog>
```

## Customizing detailed logs

**Verbose**-level logs may contain extra information and can be large. For Windows - Legacy projects, you can control this by customizing the `UiPath.Executor.exe.config` file, in the `net472` folder of the Robot installation folder. Windows and cross-platform projects don't read this file.

:::important
A Robot update installs into a new versioned folder and copies only `UiPath.config` and `NuGet.config` to it, so your edits to `UiPath.Executor.exe.config` don't carry over. Apply them again after each update.
:::

Add the following XML snippet under the `<system.serviceModel>` section, then restart the Robot Service:
```
<tracking>
    <profiles>
        <trackingProfile name="StandardProfile">
         <workflow>
          <activityStateQueries>  
            <activityStateQuery activityName="*">
                <states>  
                    <state name="Faulted"/>  
                </states>
                <arguments>  
                    <argument name="*"/>  
                </arguments> 
                 <variables>  
                    <variable name="*"/>  
                </variables>             
            </activityStateQuery>
          </activityStateQueries>    
         </workflow>
        </trackingProfile>       
    </profiles>
</tracking>
```

The `<states>` tag contains sub-tags for each state you want to log. If it only contains `<state name="Faulted"/>`, then only activities that end in a **Faulted** state, meaning they encountered an error, are logged.

To include other states, use `<state name="Executing"/>`.

You can customize variables and arguments as well. Refer to the [Microsoft documentation](https://learn.microsoft.com/en-us/dotnet/framework/windows-workflow-foundation/tracking-profiles).

## Managing driver diagnostic logs

Driver tracing records the UiPath drivers and the browser extension. For the command reference, refer to [Robot Command Line Interface](https://docs.uipath.com/robot/standalone/2026.10/admin-guide/command-line-interface).

**To enable driver tracing**:
1. Open Command Prompt with administrator rights.
2. Access the Robot installation directory using the `cd` argument, such as `cd "C:\Program Files\UiPathPlatform\Robot\<version>"` for a per-machine installation, or `cd "%LocalAppData%\Programs\UiPathPlatform\Robot\<version>"` for a per-user installation.
3. Run the `UiRobot.exe trace --enableLowLevel` command.

**To disable driver tracing**:
1. Open Command Prompt with administrator rights.
2. Access the Robot installation directory using the `cd` argument, such as `cd "C:\Program Files\UiPathPlatform\Robot\<version>"` for a per-machine installation, or `cd "%LocalAppData%\Programs\UiPathPlatform\Robot\<version>"` for a per-user installation.
3. Run the `UiRobot.exe trace --disableLowLevel` command.

The disable command saves the trace as `UiPathTrace-<id>.etl` on the Desktop of the user who runs the command.

## Using the Diagnostic tool

Check the [About the Diagnostic Tool](https://docs.uipath.com/studio/standalone/latest/user-guide/diagnostic-tool#the-start-section) page in the Studio guide for information about how you can configure it to retrieve execution logs.
