Added logic to compress and save log