move logger inside