Merge "Bug 884863: nova logs everything to syslog twice"

This commit is contained in:
Jenkins 2011-11-03 03:07:56 +00:00 committed by Gerrit Code Review
commit 4fb1eda581

View File

@ -249,11 +249,12 @@ class NovaRootLogger(NovaLogger):
def setup_from_flags(self):
"""Setup logger from flags."""
global _filelog
if self.syslog:
self.removeHandler(self.syslog)
self.syslog = None
if FLAGS.use_syslog:
self.syslog = SysLogHandler(address='/dev/log')
self.addHandler(self.syslog)
elif self.syslog:
self.removeHandler(self.syslog)
logpath = _get_log_file_path()
if logpath:
self.removeHandler(self.streamlog)