Fix #2729 - Remove illegal characters from log before export