Adding logging for exception