Adding logging mechanism