[0.17 cherry-pick] log related stuff + 1 unit test fix