Cleanup and output logs