Adds trace logging statements during election and cluster join/leave.

This is a temporary commit, because we need the execution powers of the CI
 system which seems capable of reproducing some edge case failures. After this
 task is done it should be reverted and if prudent, polished and reapplied.