Attaching run log at the end of a run

Hello, I am wondering if i am able to attach a run log to a email that was created for that specific run. I am not using Orchestrater for this task.

Welcome @P_Harry!

Logs are kept by day so there is no such thing as an individual “run log”. You can either (a) attach the day log to the email, which would provide information about all runs that day or you can (b) create a separate log file and write text to that per run. Then at the end of the run you could attach your custom log file to an email.

To attach to an email you simply give the filepath of the file you want to attach in the Attachments parameter

Hi Daniel , thank you for the quick response. I see what you mean by the logs being daily. Lets say I wanted to go ahead and attach the daily log to the email. Is there a way I can specify the most up to date log without editing the steps to select the most current log everyday?

@P_Harry
You can use the current date:
"C:\Users\your_username\AppData\Local\UiPath\Logs\" + DateTime.Today.ToString("yyyy-MM-dd") + _Execution.log"

Or you can search for the last updated file in the folder;

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.