Refactor enviromental info injection in context logs; Add unittests