summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-10-23 16:50:22 +0000
committerGerrit Code Review <review@openstack.org>2012-10-23 16:50:22 +0000
commitdc9c4e44f8464900e5baa3bf4933e8e7067166f4 (patch)
tree9307435283efd3623370179540cd87eb2f72469f
parent3fddbb2dffc50178cf9898aa2cce877c225b92d0 (diff)
parentc01c852c808970ff649c26a0e52d34b3c2d80b0b (diff)
downloadnova-dc9c4e44f8464900e5baa3bf4933e8e7067166f4.tar.gz
nova-dc9c4e44f8464900e5baa3bf4933e8e7067166f4.tar.xz
nova-dc9c4e44f8464900e5baa3bf4933e8e7067166f4.zip
Merge "Enable custom eventlet.wsgi.server log_format"
-rw-r--r--nova/wsgi.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/nova/wsgi.py b/nova/wsgi.py
index afb5303e4..0aee50ea7 100644
--- a/nova/wsgi.py
+++ b/nova/wsgi.py
@@ -32,10 +32,21 @@ import webob.exc
from nova import exception
from nova import flags
+from nova.openstack.common import cfg
from nova.openstack.common import log as logging
-
+wsgi_opts = [
+ cfg.StrOpt('wsgi_log_format',
+ default='%(client_ip)s "%(request_line)s" status: %(status_code)s'
+ ' len: %(body_length)s time: %(wall_seconds).7f',
+ help='A python format string that is used as the template to '
+ 'generate log lines. The following values can be formatted '
+ 'into it: client_ip, date_time, request_line, status_code, '
+ 'body_length, wall_seconds.')
+ ]
FLAGS = flags.FLAGS
+FLAGS.register_opts(wsgi_opts)
+
LOG = logging.getLogger(__name__)
@@ -83,7 +94,8 @@ class Server(object):
self.app,
protocol=self._protocol,
custom_pool=self._pool,
- log=self._wsgi_logger)
+ log=self._wsgi_logger,
+ log_format=FLAGS.wsgi_log_format)
def stop(self):
"""Stop this server.