MDL-37658 logging: fixed bug in legacy logging