split logging functionalities to separate file