Fix Logging when daemonizing