Merge branch 'master' of github.com:open-cloud/xos
diff --git a/xos/configurations/opencloud/Dockerfile b/xos/configurations/opencloud/Dockerfile
index 51eeba3..5a4db61 100644
--- a/xos/configurations/opencloud/Dockerfile
+++ b/xos/configurations/opencloud/Dockerfile
@@ -132,7 +132,7 @@
 RUN bash /opt/xos/tosca/install_tosca.sh
 
 # configure nginx
-RUN cp /opt/xos/nginx/xos.conf /etc/nginx/sites-enabled/
+RUN cp /opt/xos/nginx/xos.conf /etc/nginx/sites-enabled/default
 
 # Supervisor configuration
 RUN cp /opt/xos/configurations/opencloud/supervisord.conf  /etc/supervisor/conf.d/xos-all.conf
diff --git a/xos/nginx/xos.conf b/xos/nginx/xos.conf
index 1d1bb18..64d9d5e 100644
--- a/xos/nginx/xos.conf
+++ b/xos/nginx/xos.conf
@@ -6,7 +6,8 @@
 
 
 server {
-    listen 80;
+    listen   80;
+    listen   [::]:80 default ipv6only=on; ## listen for ipv6
     server_name 127.0.0.1;
 
     location /static/ {
diff --git a/xos/observers/vcpe/vcpe_stats_notifier.py b/xos/observers/vcpe/vcpe_stats_notifier.py
index f4bb923..d726e3c 100644
--- a/xos/observers/vcpe/vcpe_stats_notifier.py
+++ b/xos/observers/vcpe/vcpe_stats_notifier.py
@@ -14,7 +14,11 @@
 level=logging.INFO
 logger=logging.getLogger('vcpe_stats_notifier')
 logger.setLevel(level)
+# create formatter
+formatter = logging.Formatter("%(asctime)s;%(levelname)s;%(message)s")
 handler=logging.handlers.RotatingFileHandler(logfile,maxBytes=1000000, backupCount=1)
+# add formatter to handler
+handler.setFormatter(formatter)
 logger.addHandler(handler)
 
 def extract_dns_stats_from_all_vcpes():
@@ -105,6 +109,9 @@
 def publish_cpe_stats():
      global producer
      global keystone_tenant_id, keystone_user_id, cpe_publisher_id
+
+     logger.debug('publish_cpe_stats invoked')
+
      cpe_container_stats = extract_dns_stats_from_all_vcpes()
 
      for k,v in cpe_container_stats.iteritems():
@@ -119,6 +126,8 @@
                             }
                 }
           producer.publish(msg)
+          logger.debug('Publishing vcpe event: %s', msg)
+
           if 'cache_size' in v:
                msg = {'event_type': 'vcpe.dns.cache.size', 
                       'message_id':six.text_type(uuid.uuid4()),
@@ -132,6 +141,8 @@
                                  }
                      }
                producer.publish(msg)
+               logger.debug('Publishing vcpe.dns.cache.size event: %s', msg)
+
           if 'total_inserted_entries' in v:
                msg = {'event_type': 'vcpe.dns.total_inserted_entries', 
                       'message_id':six.text_type(uuid.uuid4()),
@@ -145,6 +156,8 @@
                                  }
                      }
                producer.publish(msg)
+               logger.debug('Publishing vcpe.dns.total_inserted_entries event: %s', msg)
+
           if 'replaced_unexpired_entries' in v:
                msg = {'event_type': 'vcpe.dns.replaced_unexpired_entries', 
                       'message_id':six.text_type(uuid.uuid4()),
@@ -158,6 +171,7 @@
                                  }
                      }
                producer.publish(msg)
+               logger.debug('Publishing vcpe.dns.replaced_unexpired_entries event: %s', msg)
 
           if 'queries_forwarded' in v:
                msg = {'event_type': 'vcpe.dns.queries_forwarded', 
@@ -172,6 +186,7 @@
                                  }
                      }
                producer.publish(msg)
+               logger.debug('Publishing vcpe.dns.queries_forwarded event: %s', msg)
 
           if 'queries_answered_locally' in v:
                msg = {'event_type': 'vcpe.dns.queries_answered_locally', 
@@ -186,6 +201,7 @@
                                  }
                      }
                producer.publish(msg)
+               logger.debug('Publishing vcpe.dns.queries_answered_locally event: %s', msg)
 
           if 'server_stats' in v:
                for server in v['server_stats']:
@@ -202,6 +218,7 @@
                                      }
                          }
                    producer.publish(msg)
+                   logger.debug('Publishing vcpe.dns.server.queries_sent event: %s', msg)
 
                    msg = {'event_type': 'vcpe.dns.server.queries_failed', 
                           'message_id':six.text_type(uuid.uuid4()),
@@ -216,6 +233,7 @@
                                      }
                          }
                    producer.publish(msg)
+                   logger.debug('Publishing vcpe.dns.server.queries_failed event: %s', msg)
 
 def periodic_publish():
      publish_cpe_stats()
diff --git a/xos/uwsgi/xos.ini b/xos/uwsgi/xos.ini
index 2eda98d..4c3f62c 100644
--- a/xos/uwsgi/xos.ini
+++ b/xos/uwsgi/xos.ini
@@ -2,7 +2,7 @@
 chdir = /opt/xos
 module = xos.wsgi:application
 env = DJANGO_SETTINGS_MODULE=xos.settings
-socket = /var/run/uwsgi/xos.sock
+socket = /var/run/uwsgi.xos.sock
 socket = 127.0.0.1:9001
 http = 127.0.0.1:9002
 stats = 127.0.0.1:9003
@@ -12,7 +12,7 @@
 uid = uwsgi
 gid = webserver 
 harakiri = 20
-daemonize=/var/log/uwsgi/xos.log 
+daemonize=/var/log/uwsgi.xos.log 
 static-map = /static=/var/www/xos/static
-pidfile = /var/run/uwsgi/uwsgi.pid
+pidfile = /var/run/uwsgi.xos.pid
 buffer-size = 8192
diff --git a/xos/xos/settings.py b/xos/xos/settings.py
index e660352..3e64d15 100644
--- a/xos/xos/settings.py
+++ b/xos/xos/settings.py
@@ -120,6 +120,12 @@
 
 # Python dotted path to the WSGI application used by Django's runserver.
 WSGI_APPLICATION = 'xos.wsgi.application'
+# Default: 'csrftoken'
+CSRF_COOKIE_NAME = 'xoscsrftoken'
+# Default: 'django_language'
+LANGUAGE_COOKIE_NAME = 'xos_django_language'
+# Default: 'sessionid'
+SESSION_COOKIE_NAME = 'xossessionid'
 
 TEMPLATE_DIRS = (
     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".