From d940dc40e6d8cdd688314203e9f12f2149380c19 Mon Sep 17 00:00:00 2001 From: Joe Heck Date: Tue, 10 Jan 2012 14:33:15 -0800 Subject: fixing imports for syslog handlers and gettext --- keystone/config.py | 6 +++--- keystone/logging.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/keystone/config.py b/keystone/config.py index 5bb084c2..6e8e163f 100644 --- a/keystone/config.py +++ b/keystone/config.py @@ -65,13 +65,13 @@ def setup_logging(conf): if conf.use_syslog: try: - facility = getattr(logging.handlers.SysLogHandler, + facility = getattr(logging.SysLogHandler, conf.syslog_log_facility) except AttributeError: raise ValueError(_("Invalid syslog facility")) - handler = logging.handlers.SysLogHandler(address='/dev/log', - facility=facility) + handler = logging.SysLogHandler(address='/dev/log', + facility=facility) elif conf.log_file: logfile = conf.log_file if conf.log_dir: diff --git a/keystone/logging.py b/keystone/logging.py index d7cc6756..bac4e238 100644 --- a/keystone/logging.py +++ b/keystone/logging.py @@ -4,6 +4,7 @@ import functools import logging import pprint +from logging.handlers import SysLogHandler # A list of things we want to replicate from logging. # levels @@ -36,7 +37,7 @@ Formatter = logging.Formatter StreamHandler = logging.StreamHandler #WatchedFileHandler = logging.handlers.WatchedFileHandler # logging.SysLogHandler is nicer than logging.logging.handler.SysLogHandler. -#SysLogHandler = logging.handlers.SysLogHandler +SysLogHandler = SysLogHandler def log_debug(f): -- cgit