save logging into db