Added data loggign to sql db.