Extracting method to logger