monitor: Log changes to database