Currently all of our bots write to log files in a central location on a file share server. These logs contain information about what steps a bot has performed and are used for troubleshooting. Sometimes bots fail after hours because the file share server is getting patched and the bot cannot access the log file. I don’t want an entire process to fail because the bot couldn’t write to the log. I could put each log to file action in a try catch, but it would be tedious to update existing bots and make the code very long. Fifty lines of code would become two hundred.
We’ve considered other options, but they come with their own challenges:
- Log to database - same patching problem would occur
- Log to the local device - we currently have 14 bot running devices and it would be difficult to track down individual logs
- In Catch, check the box for “On error, continue with next action” - this would only work if each write to log action was in a try catch block. Otherwise if there is an application error the process should stop.
- Log to a file in the Control Room - sometimes logs contain sensitive information and we cannot store sensitive information in the cloud
Does anyone have any other suggestions? If the try catch block is the way to go, so be it. I wanted to consult the community first and see if there were any other ideas or suggestions.