Log before triggering any events to preserve order