log database insert errors