Moving logging and error logic out of the Daemon