I provided a PR including a test: https://github.com/camunda/camunda-bpm-platform/pull/236
I think it is a cleaner setup, because although it is now public api, when I see
and I pass a context instance, I assume that this context is logged ... and not modified.
I had some trouble to figure out how this works (because when you are not logged in on the identityService, a userId you set manually is overwritten by null ... and then the operation log entry is not written unless you configure the restriction for logs without userIds ....
This can be easier. And maybe it could become part of the public api someday?