Restored shutdown logging (accidentally deleted).