Convert event logging to a service so we can use it in other things than controllers