Custom Logs - Best Practices?

Can anyone share me some of logs format you follow that is good for a long term maintainability

  1. Type of logs :- Text file or Tabular
  2. Types of format :- Per transaction activity logging and transaction status or etc.
  3. PARAM’s that should be always there in a text or tabular data logs

or anyother advice you can provide

“Best practices” is a very overrated term mostly, yet still very useful.
Be careful not to follow them blindly, but use them as a starting point to use the wisdom of others before you. Add/change whatever works for you, but consider the ‘why’ on a best practice. Keep that brain active :slight_smile:

As for logs:
Not sure if it is considered a best practice but here’s how I approach it.

  • I only use Orchestrator logs, no additional storage of text files etc. I am aware that runtime UiPath also creates local logs, but these are cleaned from the client after 2-3 days retention.
  • I start and end each workflow with a log. This shows nice boundries of which part of the code is executed
  • I add logs at key decision points. This enables me to reproduce the taken process when debugging.
  • I try to limit the amount of process specific data in the logs (data privacy purposes) if it is sensitive or personal information.
  • Using REF this automatically results in separate log blocks per transaction.
  • The format and wording of the logs is attempted in such a way that the logs can almost be read like a story. It sometimes is a wee bet excessive, but, if coworkers need to take over support on one of the bots during my absence it is highly appreciated. (Or for those times you need to debug a bot you haven’t touched in over a year)
  • Consider the differences in trace/info/error/warning to support that story.
  • If you need to trace values of certain parameters you can add logfields to a log. I rarely do this but mostly because it’s not in my habits. In complex processes it can be ideal to keep track of certain runtime values without the need to create additional logs for it. Again stay aware of data privacy.

I hope this helps a bit…

1 Like

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