Flush Log Buffer on Exit