Why are the old Robot logs not getting archived even after modifying the NLog settings?
The UiPath Robot Execution Logs are stored locally before being sent to the Orchestrator. This is dependent on the available local disk space and is like a backup in scenarios where is an issue in the Bot-Orchestrator connectivity.
When the connection is restored, the logs are sent to the Orchestrator in batches in the order they had been generated. These logs are not deleted even after they have been successfully sent to Orchestrator. Hence, it may be required to archive the logs after a certain amount of time so as to prevent unnecessary clutter.
The Nlog.config file (\NLog.config) can be altered if the logs need to be archived after a certain number of days by modifying the "MaxArchiveFiles" and "MaxArchiveDays" fields.
More information can be found here:
Sometimes, even after making the required modifications, the files may not be archived as expected. This is an issue is with the use of ${shortdate}. To resolve this, modify the NLog to use a static FileName-Layout as illustrated below,
- Old days log files are not archived and removed from Logs folder
- NLog settings not deleting MaxArchiveDays or MaxArchiveFiles