Make nodaemon twistd processes log to stdout

This commit is contained in:
Vishvananda Ishaya 2010-07-30 11:29:13 -07:00
parent 10d79c8ffe
commit 912a6bd28a
2 changed files with 3 additions and 5 deletions

View File

@ -21,8 +21,6 @@
Twisted daemon for nova objectstore. Supports S3 API.
"""
import logging
from nova import flags
from nova import utils
from nova import twistd
@ -33,9 +31,6 @@ FLAGS = flags.FLAGS
def main():
# FIXME: if this log statement isn't here, no logging
# appears from other files and app won't start daemonized
logging.debug('Started HTTP server on %s' % (FLAGS.s3_port))
app = handler.get_application()
print app
return app

View File

@ -214,6 +214,9 @@ def serve(filename):
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'):