diff options
author | Anthony Young <sleepsonthefloor@gmail.com> | 2011-01-10 13:06:36 -0800 |
---|---|---|
committer | Anthony Young <sleepsonthefloor@gmail.com> | 2011-01-10 13:06:36 -0800 |
commit | 220259d6ca9131c738a2d4ea9cd28ca64edbcfeb (patch) | |
tree | 27266ddb476586ed2bb87bd53d4fef9c974da8a8 /nova/twistd.py | |
parent | 9b99e385967c4ba21d94d82aa62115fc11634118 (diff) | |
parent | 16c420ee156f8c7716c7e84b66af35cbccf5090c (diff) | |
download | nova-220259d6ca9131c738a2d4ea9cd28ca64edbcfeb.tar.gz nova-220259d6ca9131c738a2d4ea9cd28ca64edbcfeb.tar.xz nova-220259d6ca9131c738a2d4ea9cd28ca64edbcfeb.zip |
merge trunk
Diffstat (limited to 'nova/twistd.py')
-rw-r--r-- | nova/twistd.py | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/nova/twistd.py b/nova/twistd.py index 29be9c4e1..556271999 100644 --- a/nova/twistd.py +++ b/nova/twistd.py @@ -22,7 +22,6 @@ manage pid files and support syslogging. """ import gflags -import logging import os import signal import sys @@ -34,6 +33,7 @@ from twisted.python import runtime from twisted.python import usage from nova import flags +from nova import log as logging if runtime.platformType == "win32": @@ -234,22 +234,12 @@ def serve(filename): OptionsClass = WrapTwistedOptions(TwistdServerOptions) options = OptionsClass() argv = options.parseOptions() - logging.getLogger('amqplib').setLevel(logging.WARN) FLAGS.python = filename FLAGS.no_save = True if not FLAGS.pidfile: FLAGS.pidfile = '%s.pid' % name elif FLAGS.pidfile.endswith('twistd.pid'): FLAGS.pidfile = FLAGS.pidfile.replace('twistd.pid', '%s.pid' % name) - # NOTE(vish): if we're running nodaemon, redirect the log to stdout - if FLAGS.nodaemon and not FLAGS.logfile: - FLAGS.logfile = "-" - if not FLAGS.logfile: - FLAGS.logfile = '%s.log' % name - elif FLAGS.logfile.endswith('twistd.log'): - FLAGS.logfile = FLAGS.logfile.replace('twistd.log', '%s.log' % name) - if FLAGS.logdir: - FLAGS.logfile = os.path.join(FLAGS.logdir, FLAGS.logfile) if not FLAGS.prefix: FLAGS.prefix = name elif FLAGS.prefix.endswith('twisted'): @@ -270,19 +260,10 @@ def serve(filename): print 'usage: %s [options] [start|stop|restart]' % argv[0] sys.exit(1) - formatter = logging.Formatter( - '(%(name)s): %(levelname)s %(message)s') - handler = logging.StreamHandler(log.StdioOnnaStick()) - handler.setFormatter(formatter) - logging.getLogger().addHandler(handler) - - if FLAGS.verbose: - logging.getLogger().setLevel(logging.DEBUG) - else: - logging.getLogger().setLevel(logging.WARNING) - + logging.basicConfig() logging.debug(_("Full set of FLAGS:")) for flag in FLAGS: logging.debug("%s : %s" % (flag, FLAGS.get(flag, None))) + logging.audit(_("Starting %s"), name) twistd.runApp(options) |