Fix log preparation

Change-Id: Id3e0131819c33a96409578f05b3808765d6c0d08