Adding logging function to AdpageController