The bug was included in the 2.1.7 tag but it was not in the release notes.
If the session id is known, it will be logged together with all messages. If present, the session id appears, enclosed in paranthesis, right after the message category. E.g. 2017-08-30 12:20:49 warning: (4711) [masking] The rule ...
Added 2.1.7 release notes.