Start refactoring out the logging to its own module
Remove a gsub due to prefixes being removed from ENV vars
Add protection against bad socket errors