         db: 'cozy'
     }
 
+    logCouchdb = initLogCouchdb()
 
     # credentials retrieved by environment variable
     if process.env.VCAP_SERVICES?

exports.db_connect = ->
    credentials = setup_credentials()
    connection = new cradle.Connection credentials
    
    db = connection.database credentials.db
    return db

        credentials.host = couch.host ? '127.0.0.1'
        credentials.port = couch.port ? '5984'
        credentials.db = couch.name ? 'cozy'
        if logCouchdb[0]? and logCouchdb[1]?
            credentials.auth = \
                    {username: logCouchdb[0], password: logCouchdb[1]}

    return credentials

