add log db function and history