Hi. I see there are a bunch of predefined log levels: Trace, Info, Warn, Error, Fatal. I want to define a new one: “OK”. As in, to report that the RPA has successfully completed a task.
How do I do that? I’ve tried to manually write in something like LogLevel(“OK”), LogLevel.Parse(“OK”) and various other combinations but my C# skills are not that great.
I could of course do an INFO log where the message is something like “[OK] task completed successfully”, allowing me to parse everything with an [OK] as a success log (for stats) but this isn’t ideal.
Loglevels are predefined Enum types where you can’t add a custom value.
You can go with the second approach to make a master log for each transaction with identifier and necessary fields to be utilised later for any purpose like audit or dashboard etc.
Hello @ctu ,
Different log level will help to capture the logs properly for the debugging purpose and the available Log level are part of the activity and cannot be customizable. If you want to write a custom log file as part of reporting you can use a text file to write the custom logs.
Else better is to go with Log Message activity and choose log level as info
If you do ingest these logs in to a no sql database / index like Splunk or Elastic search, you will see little to no performance issues while trying to parse for success messages. We have a retention of around 12 months on our index, which now has millions or log messages and Splunk server is quick enough to parse them in about 20 seconds.
The way we log our success message for every workflow is by using the INFO log levels with our custom log messages.
- Using custom log messages with INFO and ERROR types : Creating error-proof reusable workflows in UiPath
- Ingesting logs : Logs - ElasticSearch - #6 by jeevith