From a9597626b4ab7bb0f83e445994f6bcce6c791f53 Mon Sep 17 00:00:00 2001 From: Nikolay Markov Date: Fri, 21 Sep 2012 13:32:57 +0400 Subject: [PATCH] nailgun wsgi logging to apache --- nailgun/api/handlers.py | 2 +- nailgun/wsgi.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nailgun/api/handlers.py b/nailgun/api/handlers.py index c5c5ffb87..710fe82ae 100644 --- a/nailgun/api/handlers.py +++ b/nailgun/api/handlers.py @@ -260,7 +260,7 @@ class ClusterChangesHandler(JSONHandler): allowed_statuses = ("discover", "ready") for node in cluster.nodes: if node.status not in allowed_statuses: - raise Exception( + raise web.badrequest( "Node %s (%s) status:%s not in %s" % ( node.mac, node.ip, diff --git a/nailgun/wsgi.py b/nailgun/wsgi.py index a38ef93b7..bf0e733b0 100644 --- a/nailgun/wsgi.py +++ b/nailgun/wsgi.py @@ -1,11 +1,14 @@ import os import sys +import logging import web curdir = os.path.dirname(__file__) sys.path.insert(0, curdir) +logging.basicConfig(stream=sys.stderr, level=logging.DEBUG) + from api.handlers import check_client_content_type from db import load_db_driver from urls import urls