Finalized logging and automated file deletion.