Add database interaction logging