refactored logging and added log dir