HRCPP-146 Improve trace logging (synchronization fixes)