Refactor logging

Add method to prepare directory structure when server starts first time.