save log to db