Improve multipart message logging (bug #1540)