Adding logging for event hooks.