move logger initialization to method scope