How to capture Output logs in a variable

Is there a way I can capture the output logs into a variable? The idea is I want to put a try-catch in the main block and if the script fails, I want to send an email to myself with the output logs so I can see where it failed. I got studio (no orchestrator or re-framework). Thanks!

Output logs are stored in: “…\AppData\Local\UiPath\Logs”

You can also click on this button in studio to get to them:

From there, it’s just a matter of attaching it as a file in send email activity.

I prefer to create my own output log .txt so it doesn’t capture all the INFO/trace stuff.
You can use my AppendLog workflow to make it easier for you. Just Invoke it and change the Import arguments whenever you want to add a new line to the Log.

AppendLog.xaml (8.5 KB)

@x.Rei.Ai.x Thanks for replying so fast! Actually the logs I am looking for are the ‘Output Logs’ as it shows up in the Output Window. I thought are the execution logs but these really are output activity as the bot executes…any idea where these might be?

@jaspreet1003 No problem. The Execution Logs of …\AppData\Local\UiPath\Logs are the logs that are displayed in the Output window. The Notepad just reveals all the syntax. The Output Window “cleans” it up for us to read it easier, but, as far as I know, it is in fact what the Output Window is displaying from.

If your bot is connected to Orchestrator and you’ve set the Orchestrator settings Level to Trace. it will display all the Trace info in the job status section.


1 Like

@x.Rei.Ai.x Thanks but this is a stand alone bot and is not connected to orchestrator. I checked the execution logs and I think you are correct that these are the ones displayed in Output…I am just wondering if there is a way I can have it email it to me in the same format as they are displayed in the output window since its so much easier to read them.

@x.Rei.Ai.x Thanks for your help. I appreciate it.

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