Clean up the shutdown of the logger