Add logging to make troubleshooting easier when the script is running as a service
Add logging to make troubleshooting easier when the script is running as a service