Refactoring to set path for logging