diff options
| author | Thierry Carrez <thierry@openstack.org> | 2011-01-21 16:24:39 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-01-21 16:24:39 +0000 |
| commit | 977393fe3e487926899f3f64cfd33f39105cc97e (patch) | |
| tree | eeed0c2e7e11fd3f5be31575ff394390a7b05d2e /nova | |
| parent | 14edbd55e667b16b8d46c0230b11ccd964f5742f (diff) | |
| parent | 2042c8722910c1f22ba04636163841812b3e24ba (diff) | |
Change default log formats so that:
* they include a timestamp (necessary to correlate logs)
* no longer display version on every line (shorter lines)
* use [-] instead of [N/A] (shorter lines, less scary-looking)
* show level before logger name (better human-readability)
Display version once at node startup time instead.
Fix description of the log format flags.
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/log.py | 8 | ||||
| -rw-r--r-- | nova/service.py | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/nova/log.py b/nova/log.py index 4997d3f28..e1c9f46f4 100644 --- a/nova/log.py +++ b/nova/log.py @@ -40,15 +40,15 @@ from nova import version FLAGS = flags.FLAGS flags.DEFINE_string('logging_context_format_string', - '(%(name)s %(nova_version)s): %(levelname)s ' + '%(asctime)s %(levelname)s %(name)s ' '[%(request_id)s %(user)s ' '%(project)s] %(message)s', - 'format string to use for log messages') + 'format string to use for log messages with context') flags.DEFINE_string('logging_default_format_string', - '(%(name)s %(nova_version)s): %(levelname)s [N/A] ' + '%(asctime)s %(levelname)s %(name)s [-] ' '%(message)s', - 'format string to use for log messages') + 'format string to use for log messages without context') flags.DEFINE_string('logging_debug_format_suffix', 'from %(processName)s (pid=%(process)d) %(funcName)s' diff --git a/nova/service.py b/nova/service.py index efc08fd63..91e00d3d1 100644 --- a/nova/service.py +++ b/nova/service.py @@ -38,6 +38,7 @@ from nova import log as logging from nova import flags from nova import rpc from nova import utils +from nova import version FLAGS = flags.FLAGS @@ -156,7 +157,8 @@ class Service(object): report_interval = FLAGS.report_interval if not periodic_interval: periodic_interval = FLAGS.periodic_interval - logging.audit(_("Starting %s node"), topic) + logging.audit(_("Starting %s node (version %s)"), topic, + version.version_string_with_vcs()) service_obj = cls(host, binary, topic, manager, report_interval, periodic_interval) |
