refactoring: extracted method for initialization of logging and covered with unittests