Add logging and daemonizing function to the server