diff --git a/etc/quantum.conf b/etc/quantum.conf index 8cb9f81439..e767102ef2 100644 --- a/etc/quantum.conf +++ b/etc/quantum.conf @@ -1,23 +1,29 @@ [DEFAULT] -# Default log level is WARNING -# Show debugging output in logs (sets DEBUG log level output) +# Default log level is INFO +# verbose and debug has the same result. +# One of them will set DEBUG log level output # debug = False - -# Show more verbose log output (sets INFO log level output) if debug is False # verbose = False # log_format = %(asctime)s %(levelname)8s [%(name)s] %(message)s # log_date_format = %Y-%m-%d %H:%M:%S +# use_syslog -> syslog +# log_file and log_dir -> log_dir/log_file +# (not log_file) and log_dir -> log_dir/{binary_name}.log +# use_stderr -> stderr +# (not user_stderr) and (not log_file) -> stdout +# publish_errors -> notification system + # use_syslog = False # syslog_log_facility = LOG_USER -# if use_syslog is False, we can set log_file and log_dir. -# if use_syslog is False and we do not set log_file, -# the log will be printed to stdout. +# use_stderr = True # log_file = # log_dir = +# publish_errors = False + # Address to bind the API server bind_host = 0.0.0.0 diff --git a/quantum/agent/dhcp_agent.py b/quantum/agent/dhcp_agent.py index 044d7246f2..b4e6e6dcc1 100644 --- a/quantum/agent/dhcp_agent.py +++ b/quantum/agent/dhcp_agent.py @@ -15,7 +15,6 @@ # License for the specific language governing permissions and limitations # under the License. -import logging import os import re import socket @@ -37,6 +36,7 @@ from quantum.openstack.common import cfg from quantum.openstack.common import context from quantum.openstack.common import importutils from quantum.openstack.common import jsonutils +from quantum.openstack.common import log as logging from quantum.openstack.common.rpc import proxy LOG = logging.getLogger(__name__) diff --git a/quantum/agent/l3_agent.py b/quantum/agent/l3_agent.py index 26a56fc71f..3707e9162e 100644 --- a/quantum/agent/l3_agent.py +++ b/quantum/agent/l3_agent.py @@ -19,7 +19,6 @@ # """ -import logging import sys import time @@ -33,6 +32,7 @@ from quantum.agent.linux import utils from quantum.db import l3_db from quantum.openstack.common import cfg from quantum.openstack.common import importutils +from quantum.openstack.common import log as logging from quantumclient.v2_0 import client LOG = logging.getLogger(__name__) diff --git a/quantum/agent/linux/dhcp.py b/quantum/agent/linux/dhcp.py index c591e38625..304e2ce459 100644 --- a/quantum/agent/linux/dhcp.py +++ b/quantum/agent/linux/dhcp.py @@ -16,7 +16,6 @@ # under the License. import abc -import logging import os import re import socket @@ -30,6 +29,7 @@ from quantum.agent.linux import ip_lib from quantum.agent.linux import utils from quantum.openstack.common import cfg from quantum.openstack.common import jsonutils +from quantum.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/agent/linux/interface.py b/quantum/agent/linux/interface.py index b3b5a8ac6a..a8e9dd7384 100644 --- a/quantum/agent/linux/interface.py +++ b/quantum/agent/linux/interface.py @@ -16,7 +16,6 @@ # under the License. import abc -import logging import netaddr @@ -27,6 +26,7 @@ from quantum.common import exceptions from quantum.extensions.flavor import (FLAVOR_NETWORK) from quantum.openstack.common import cfg from quantum.openstack.common import importutils +from quantum.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/agent/linux/iptables_manager.py b/quantum/agent/linux/iptables_manager.py index 83b4d8af2d..5201820f03 100644 --- a/quantum/agent/linux/iptables_manager.py +++ b/quantum/agent/linux/iptables_manager.py @@ -22,10 +22,10 @@ """Implements iptables rules using linux utilities.""" import inspect -import logging import os from quantum.agent.linux import utils +from quantum.openstack.common import log as logging LOG = logging.getLogger(__name__) # NOTE(vish): Iptables supports chain names of up to 28 characters, and we diff --git a/quantum/agent/linux/ovs_lib.py b/quantum/agent/linux/ovs_lib.py index 9eaa67e30f..65d840e413 100644 --- a/quantum/agent/linux/ovs_lib.py +++ b/quantum/agent/linux/ovs_lib.py @@ -18,10 +18,10 @@ # @author: Dan Wendlandt, Nicira Networks, Inc. # @author: Dave Lapsley, Nicira Networks, Inc. -import logging import re from quantum.agent.linux import utils +from quantum.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/agent/linux/utils.py b/quantum/agent/linux/utils.py index 0d11aa0c07..8f62753036 100644 --- a/quantum/agent/linux/utils.py +++ b/quantum/agent/linux/utils.py @@ -18,7 +18,6 @@ # @author: Juliano Martinez, Locaweb. import fcntl -import logging import os import shlex import signal @@ -28,7 +27,7 @@ import struct from eventlet.green import subprocess from quantum.common import utils - +from quantum.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/agent/netns_cleanup_util.py b/quantum/agent/netns_cleanup_util.py index 3b479d76da..7271968b3c 100644 --- a/quantum/agent/netns_cleanup_util.py +++ b/quantum/agent/netns_cleanup_util.py @@ -1,4 +1,3 @@ -import logging import re import sys @@ -13,6 +12,7 @@ from quantum.api.v2 import attributes from quantum.common import config from quantum.openstack.common import cfg from quantum.openstack.common import importutils +from quantum.openstack.common import log as logging LOG = logging.getLogger(__name__) NS_MANGLING_PATTERN = ('(%s|%s)' % (dhcp_agent.NS_PREFIX, l3_agent.NS_PREFIX) + diff --git a/quantum/agent/rpc.py b/quantum/agent/rpc.py index ff7aa50498..720bb54761 100644 --- a/quantum/agent/rpc.py +++ b/quantum/agent/rpc.py @@ -13,12 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging - import eventlet from quantum.common import topics +from quantum.openstack.common import log as logging from quantum.openstack.common import rpc from quantum.openstack.common.rpc import proxy from quantum.openstack.common.notifier import api diff --git a/quantum/api/api_common.py b/quantum/api/api_common.py index 8ea128c9db..e9bb12fcfa 100644 --- a/quantum/api/api_common.py +++ b/quantum/api/api_common.py @@ -15,10 +15,10 @@ # License for the specific language governing permissions and limitations # under the License. -import logging from webob import exc +from quantum.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/api/v2/attributes.py b/quantum/api/v2/attributes.py index 205e7cc47e..306df78ca6 100644 --- a/quantum/api/v2/attributes.py +++ b/quantum/api/v2/attributes.py @@ -17,12 +17,11 @@ ATTR_NOT_SPECIFIED = object() # Defining a constant to avoid repeating string literal in several modules SHARED = 'shared' -import logging import netaddr import re from quantum.common import exceptions as q_exc - +from quantum.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/api/v2/base.py b/quantum/api/v2/base.py index d6b832356c..0adcf0907e 100644 --- a/quantum/api/v2/base.py +++ b/quantum/api/v2/base.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging import socket import webob.exc @@ -22,6 +21,7 @@ from quantum.api.v2 import attributes from quantum.api.v2 import resource as wsgi_resource from quantum.common import exceptions from quantum.openstack.common import cfg +from quantum.openstack.common import log as logging from quantum.openstack.common.notifier import api as notifier_api from quantum import policy from quantum import quota diff --git a/quantum/api/v2/resource.py b/quantum/api/v2/resource.py index 560ac52e9d..367edae751 100644 --- a/quantum/api/v2/resource.py +++ b/quantum/api/v2/resource.py @@ -16,7 +16,6 @@ """ Utility methods for working with WSGI servers redux """ -import logging import webob import webob.dec @@ -25,6 +24,7 @@ import webob.exc from quantum.common import exceptions from quantum import context from quantum.openstack.common import jsonutils as json +from quantum.openstack.common import log as logging from quantum import wsgi diff --git a/quantum/api/v2/router.py b/quantum/api/v2/router.py index dcd719373d..ca561d01fa 100644 --- a/quantum/api/v2/router.py +++ b/quantum/api/v2/router.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging import urlparse import routes as routes_mapper @@ -26,6 +25,7 @@ from quantum.api.v2 import base from quantum.extensions import extensions from quantum import manager from quantum.openstack.common import cfg +from quantum.openstack.common import log as logging from quantum import wsgi diff --git a/quantum/api/versions.py b/quantum/api/versions.py index 0e4c093626..9287d04a54 100644 --- a/quantum/api/versions.py +++ b/quantum/api/versions.py @@ -15,10 +15,10 @@ # License for the specific language governing permissions and limitations # under the License. -import logging import webob.dec from quantum.api.views import versions as versions_view +from quantum.openstack.common import log as logging from quantum import wsgi diff --git a/quantum/auth.py b/quantum/auth.py index 4492dcdc45..3cdb3d93e1 100644 --- a/quantum/auth.py +++ b/quantum/auth.py @@ -14,15 +14,13 @@ # License for the specific language governing permissions and limitations # under the License. -import logging - import webob.dec import webob.exc from quantum import context from quantum import wsgi from quantum.openstack.common import cfg - +from quantum.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/common/config.py b/quantum/common/config.py index 405a9023b5..d78a3b6410 100644 --- a/quantum/common/config.py +++ b/quantum/common/config.py @@ -19,9 +19,6 @@ Routines for configuring Quantum """ -import logging -import logging.config -import logging.handlers import os import sys @@ -29,9 +26,9 @@ from paste import deploy from quantum.api.v2 import attributes from quantum.openstack.common import cfg +from quantum.openstack.common import log as logging from quantum.version import version_string - LOG = logging.getLogger(__name__) core_opts = [ @@ -79,45 +76,10 @@ def setup_logging(conf): :param conf: a cfg.ConfOpts object """ - - if conf.log_config: - # Use a logging configuration file for all settings... - if os.path.exists(conf.log_config): - logging.config.fileConfig(conf.log_config) - return - else: - raise RuntimeError("Unable to locate specified logging " - "config file: %s" % conf.log_config) - - root_logger = logging.root - if conf.debug: - root_logger.setLevel(logging.DEBUG) - elif conf.verbose: - root_logger.setLevel(logging.INFO) - else: - root_logger.setLevel(logging.WARNING) - - formatter = logging.Formatter(conf.log_format, conf.log_date_format) - - if conf.use_syslog: - try: - facility = getattr(logging.handlers.SysLogHandler, - conf.syslog_log_facility) - except AttributeError: - raise ValueError(_("Invalid syslog facility")) - - handler = logging.handlers.SysLogHandler(address='/dev/log', - facility=facility) - elif conf.log_file: - logfile = conf.log_file - if conf.log_dir: - logfile = os.path.join(conf.log_dir, logfile) - handler = logging.handlers.WatchedFileHandler(logfile) - else: - handler = logging.StreamHandler(sys.stdout) - - handler.setFormatter(formatter) - root_logger.addHandler(handler) + product_name = "quantum" + logging.setup(product_name) + log_root = logging.getLogger(product_name).logger + log_root.propagate = 0 LOG.info("Logging enabled!") diff --git a/quantum/common/utils.py b/quantum/common/utils.py index f57fafca84..8b9015cf5f 100644 --- a/quantum/common/utils.py +++ b/quantum/common/utils.py @@ -21,7 +21,6 @@ """Utilities and helper functions.""" -import logging import os import signal import uuid @@ -29,8 +28,10 @@ import uuid from eventlet.green import subprocess from quantum.openstack.common import cfg +from quantum.openstack.common import log as logging TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ" +LOG = logging.getLogger(__name__) def boolize(subject): @@ -60,7 +61,7 @@ def read_cached_file(filename, cache_info, reload_func=None): """ mtime = os.path.getmtime(filename) if not cache_info or mtime != cache_info.get('mtime'): - logging.debug(_("Reloading cached file %s") % filename) + LOG.debug(_("Reloading cached file %s") % filename) with open(filename) as fap: cache_info['data'] = fap.read() cache_info['mtime'] = mtime diff --git a/quantum/context.py b/quantum/context.py index c2555f5232..0013c9f436 100644 --- a/quantum/context.py +++ b/quantum/context.py @@ -18,12 +18,14 @@ """Context: context for security/db session.""" import copy -import logging from datetime import datetime from quantum.db import api as db_api from quantum.openstack.common import context as common_context +from quantum.openstack.common import log as logging + + LOG = logging.getLogger(__name__) diff --git a/quantum/db/api.py b/quantum/db/api.py index a5f5cc99e2..4c0de4cdbf 100644 --- a/quantum/db/api.py +++ b/quantum/db/api.py @@ -17,7 +17,6 @@ # @author: Brad Hall, Nicira Networks, Inc. # @author: Dan Wendlandt, Nicira Networks, Inc. -import logging import time import sqlalchemy as sql @@ -26,6 +25,7 @@ from sqlalchemy.exc import DisconnectionError from sqlalchemy.orm import sessionmaker, exc from quantum.db import model_base +from quantum.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/db/db_base_plugin_v2.py b/quantum/db/db_base_plugin_v2.py index 36da230afa..705bb138a4 100644 --- a/quantum/db/db_base_plugin_v2.py +++ b/quantum/db/db_base_plugin_v2.py @@ -14,7 +14,6 @@ # limitations under the License. import datetime -import logging import random import netaddr @@ -28,6 +27,7 @@ from quantum.common import utils from quantum.db import api as db from quantum.db import models_v2 from quantum.openstack.common import cfg +from quantum.openstack.common import log as logging from quantum.openstack.common import timeutils from quantum import quantum_plugin_base_v2 diff --git a/quantum/db/dhcp_rpc_base.py b/quantum/db/dhcp_rpc_base.py index 42bee7812f..0fa7000b20 100644 --- a/quantum/db/dhcp_rpc_base.py +++ b/quantum/db/dhcp_rpc_base.py @@ -13,14 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging - from sqlalchemy.orm import exc from quantum import context as quantum_context from quantum import manager from quantum.api.v2 import attributes from quantum.openstack.common import context +from quantum.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/db/l3_db.py b/quantum/db/l3_db.py index 8b78bf1e2c..8c4d79848f 100644 --- a/quantum/db/l3_db.py +++ b/quantum/db/l3_db.py @@ -19,8 +19,6 @@ # """ -import logging - import netaddr import sqlalchemy as sa from sqlalchemy import orm @@ -36,6 +34,8 @@ from quantum.db import model_base from quantum.db import models_v2 from quantum.extensions import l3 from quantum.openstack.common import cfg +from quantum.openstack.common import log as logging + from quantum import policy diff --git a/quantum/extensions/extensions.py b/quantum/extensions/extensions.py index 26ff3222b1..655f3c45ed 100644 --- a/quantum/extensions/extensions.py +++ b/quantum/extensions/extensions.py @@ -19,7 +19,6 @@ from abc import ABCMeta import imp -import logging import os import routes @@ -31,6 +30,7 @@ import quantum.extensions from quantum.manager import QuantumManager from quantum.openstack.common import cfg from quantum.openstack.common import importutils +from quantum.openstack.common import log as logging from quantum import wsgi diff --git a/quantum/extensions/flavor.py b/quantum/extensions/flavor.py index f3940f5262..7b48d462eb 100644 --- a/quantum/extensions/flavor.py +++ b/quantum/extensions/flavor.py @@ -15,9 +15,8 @@ # under the License. # -import logging - from quantum.api.v2 import attributes +from quantum.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/manager.py b/quantum/manager.py index 77ab57a9aa..bb4981a86b 100644 --- a/quantum/manager.py +++ b/quantum/manager.py @@ -23,11 +23,10 @@ class. The caller should make sure that QuantumManager is a singleton. """ -import logging - from quantum.common.exceptions import ClassNotFound from quantum.openstack.common import cfg from quantum.openstack.common import importutils +from quantum.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py b/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py index 6ff3ee68fd..1d3fb55fac 100755 --- a/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py +++ b/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py @@ -22,7 +22,6 @@ # Quantum OpenVSwitch Plugin. # @author: Sumit Naiksatam, Cisco Systems, Inc. -import logging import os import sys import time @@ -38,12 +37,13 @@ from quantum.common import constants from quantum.common import topics from quantum.openstack.common import cfg from quantum.openstack.common import context +from quantum.openstack.common import log as logging from quantum.openstack.common import rpc from quantum.openstack.common.rpc import dispatcher from quantum.plugins.linuxbridge.common import config from quantum.plugins.linuxbridge.common import constants as lconst -logging.basicConfig() + LOG = logging.getLogger(__name__) BRIDGE_NAME_PREFIX = "brq" diff --git a/quantum/plugins/linuxbridge/db/l2network_db_v2.py b/quantum/plugins/linuxbridge/db/l2network_db_v2.py index 0a671852d0..dee651e437 100644 --- a/quantum/plugins/linuxbridge/db/l2network_db_v2.py +++ b/quantum/plugins/linuxbridge/db/l2network_db_v2.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging from sqlalchemy.orm import exc @@ -21,6 +20,7 @@ from quantum.common import exceptions as q_exc import quantum.db.api as db from quantum.db import models_v2 from quantum.openstack.common import cfg +from quantum.openstack.common import log as logging from quantum.plugins.linuxbridge.common import config from quantum.plugins.linuxbridge.common import constants from quantum.plugins.linuxbridge.db import l2network_models_v2 diff --git a/quantum/plugins/linuxbridge/lb_quantum_plugin.py b/quantum/plugins/linuxbridge/lb_quantum_plugin.py index 49a1ec10de..173f2e6fd7 100644 --- a/quantum/plugins/linuxbridge/lb_quantum_plugin.py +++ b/quantum/plugins/linuxbridge/lb_quantum_plugin.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging import sys from quantum.api.v2 import attributes @@ -28,6 +27,7 @@ from quantum.db import models_v2 from quantum.extensions import providernet as provider from quantum.openstack.common import context from quantum.openstack.common import cfg +from quantum.openstack.common import log as logging from quantum.openstack.common import rpc from quantum.openstack.common.rpc import dispatcher from quantum.openstack.common.rpc import proxy diff --git a/quantum/plugins/openvswitch/agent/ovs_quantum_agent.py b/quantum/plugins/openvswitch/agent/ovs_quantum_agent.py index 4f332e11db..2a8aa169e7 100755 --- a/quantum/plugins/openvswitch/agent/ovs_quantum_agent.py +++ b/quantum/plugins/openvswitch/agent/ovs_quantum_agent.py @@ -20,7 +20,6 @@ # @author: Dave Lapsley, Nicira Networks, Inc. # @author: Aaron Rosen, Nicira Networks, Inc. -import logging import sys import time @@ -35,12 +34,13 @@ from quantum.common import config as logging_config from quantum.common import topics from quantum.openstack.common import cfg from quantum.openstack.common import context +from quantum.openstack.common import log as logging from quantum.openstack.common import rpc from quantum.openstack.common.rpc import dispatcher from quantum.plugins.openvswitch.common import config from quantum.plugins.openvswitch.common import constants -logging.basicConfig() + LOG = logging.getLogger(__name__) # A placeholder for dead vlans. @@ -687,8 +687,6 @@ def create_agent_config_map(config): def main(): eventlet.monkey_patch() cfg.CONF(args=sys.argv, project='quantum') - - # (TODO) gary - swap with common logging logging_config.setup_logging(cfg.CONF) try: diff --git a/quantum/plugins/openvswitch/ovs_db_v2.py b/quantum/plugins/openvswitch/ovs_db_v2.py index 5027ad3967..5e8d567ad6 100644 --- a/quantum/plugins/openvswitch/ovs_db_v2.py +++ b/quantum/plugins/openvswitch/ovs_db_v2.py @@ -16,14 +16,13 @@ # @author: Aaron Rosen, Nicira Networks, Inc. # @author: Bob Kukura, Red Hat, Inc. -import logging - from sqlalchemy.orm import exc from quantum.common import exceptions as q_exc from quantum.db import models_v2 import quantum.db.api as db from quantum.openstack.common import cfg +from quantum.openstack.common import log as logging from quantum.plugins.openvswitch.common import constants from quantum.plugins.openvswitch import ovs_models_v2 diff --git a/quantum/plugins/openvswitch/ovs_quantum_plugin.py b/quantum/plugins/openvswitch/ovs_quantum_plugin.py index 11c1569f32..008d81a1a0 100644 --- a/quantum/plugins/openvswitch/ovs_quantum_plugin.py +++ b/quantum/plugins/openvswitch/ovs_quantum_plugin.py @@ -20,7 +20,6 @@ # @author: Aaron Rosen, Nicira Networks, Inc. # @author: Bob Kukura, Red Hat, Inc. -import logging import os import sys @@ -34,6 +33,7 @@ from quantum.db import l3_db from quantum.extensions import providernet as provider from quantum.openstack.common import context from quantum.openstack.common import cfg +from quantum.openstack.common import log as logging from quantum.openstack.common import rpc from quantum.openstack.common.rpc import dispatcher from quantum.openstack.common.rpc import proxy diff --git a/quantum/policy.py b/quantum/policy.py index cd1d26f242..de9483eb2c 100644 --- a/quantum/policy.py +++ b/quantum/policy.py @@ -18,12 +18,12 @@ """ Policy engine for quantum. Largely copied from nova. """ -import logging from quantum.api.v2 import attributes from quantum.common import exceptions from quantum.openstack.common import cfg import quantum.common.utils as utils +from quantum.openstack.common import log as logging from quantum.openstack.common import policy diff --git a/quantum/quota.py b/quantum/quota.py index 4a00804c33..bcb498fc16 100644 --- a/quantum/quota.py +++ b/quantum/quota.py @@ -16,11 +16,10 @@ """Quotas for instances, volumes, and floating ips.""" -import logging - from quantum.common import exceptions from quantum.openstack.common import cfg from quantum.openstack.common import importutils +from quantum.openstack.common import log as logging LOG = logging.getLogger(__name__) quota_opts = [ diff --git a/quantum/service.py b/quantum/service.py index 48ef432e2a..f4525300b7 100644 --- a/quantum/service.py +++ b/quantum/service.py @@ -15,10 +15,9 @@ # License for the specific language governing permissions and limitations # under the License. -import logging - from quantum.common import config from quantum.openstack.common import cfg +from quantum.openstack.common import log as logging from quantum import wsgi diff --git a/quantum/wsgi.py b/quantum/wsgi.py index 065d73e0b3..946af82dd5 100644 --- a/quantum/wsgi.py +++ b/quantum/wsgi.py @@ -18,8 +18,6 @@ """ Utility methods for working with WSGI servers """ - -import logging import sys from xml.dom import minidom from xml.parsers import expat @@ -34,22 +32,11 @@ import webob.exc from quantum.common import exceptions as exception from quantum import context from quantum.openstack.common import jsonutils - +from quantum.openstack.common import log as logging LOG = logging.getLogger(__name__) -class WritableLogger(object): - """A thin wrapper that responds to `write` and logs.""" - - def __init__(self, logger, level=logging.DEBUG): - self.logger = logger - self.level = level - - def write(self, msg): - self.logger.log(self.level, msg.strip("\n")) - - def run_server(application, port): """Run a WSGI server with the given application.""" sock = eventlet.listen(('0.0.0.0', port)) @@ -79,7 +66,7 @@ class Server(object): """Start a WSGI server in a new green thread.""" logger = logging.getLogger('eventlet.wsgi.server') eventlet.wsgi.server(socket, application, custom_pool=self.pool, - log=WritableLogger(logger)) + log=logging.WritableLogger(logger)) class Middleware(object):