better event logging on shutdown