summaryrefslogtreecommitdiffstats
path: root/nova/wsgi.py
diff options
context:
space:
mode:
authorTodd Willey <todd@ansolabs.com>2011-01-04 00:23:35 -0500
committerTodd Willey <todd@ansolabs.com>2011-01-04 00:23:35 -0500
commitc7305af78049f94dedcbb55480b91a3c6d843b9f (patch)
treeb8c0305cd39408f825270f0c253c7f487ee40727 /nova/wsgi.py
parentdd1e36b9690a2c2de18c565c496b25295a13d0aa (diff)
downloadnova-c7305af78049f94dedcbb55480b91a3c6d843b9f.tar.gz
nova-c7305af78049f94dedcbb55480b91a3c6d843b9f.tar.xz
nova-c7305af78049f94dedcbb55480b91a3c6d843b9f.zip
Apply logging changes as a giant patch to work around the cloudpipe delete + add issue in the original patch.
Diffstat (limited to 'nova/wsgi.py')
-rw-r--r--nova/wsgi.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/nova/wsgi.py b/nova/wsgi.py
index b5d6b96c1..6336912e4 100644
--- a/nova/wsgi.py
+++ b/nova/wsgi.py
@@ -22,7 +22,6 @@ Utility methods for working with WSGI servers
"""
import json
-import logging
import sys
from xml.dom import minidom
@@ -35,18 +34,23 @@ import webob
import webob.dec
import webob.exc
+from nova import log as logging
-logging.getLogger("routes.middleware").addHandler(logging.StreamHandler())
+# TODO(todd): should this just piggyback the handler for root logger
+# since we usually log to syslog, but changes if not daemonzied?
+logging.getLogger("routes.middleware").addHandler(logging.StreamHandler())
class Server(object):
"""Server class to manage multiple WSGI sockets and applications."""
def __init__(self, threads=1000):
+ logging.basicConfig()
self.pool = eventlet.GreenPool(threads)
def start(self, application, port, host='0.0.0.0', backlog=128):
"""Run a WSGI server with the given application."""
+ logging.audit("Starting %s on %s:%s", sys.argv[0], host, port)
socket = eventlet.listen((host, port), backlog=backlog)
self.pool.spawn_n(self._run, application, socket)