update the function of insert log into db