db connection and logging inserted

database connection added.
logging added to site.