添加log with database implement