Clean up and customize logging