[TIMOB-12404] Fixed loging

Consolidated code into one place