I would like to add all this information that goes/prints on the terminal to a separate file. Since my VPS goes down quite often and I would like to monitor any and all errors. This is for a discord bot by the way. So I have specific error handlers for certain commands.
If you execute the script of your bot followed by > file.txt, anything shown on the stdout (the output of print()) will be written in file.txt
You can learn more on that by googling cmd redirect output to file :)
How can I get all information that gets printed to the terminal including errors