fix log messages showing in the wrong order by remembering order of creation of messages

fixes issue 619