Reformat log items, add dates and triggers to db