Added logging events to database