diff options
| author | Thierry Carrez <thierry@openstack.org> | 2011-01-20 12:20:50 +0100 |
|---|---|---|
| committer | Thierry Carrez <thierry@openstack.org> | 2011-01-20 12:20:50 +0100 |
| commit | a9c8ef031780636dd851095f0e76dabeb9eed487 (patch) | |
| tree | a654d332565e75d46d67a0eb25b444d3f12ab17a | |
| parent | 7d7fbf5dfd8a8e10f584df5d27d3479c4b2b4d3a (diff) | |
| download | nova-a9c8ef031780636dd851095f0e76dabeb9eed487.tar.gz nova-a9c8ef031780636dd851095f0e76dabeb9eed487.tar.xz nova-a9c8ef031780636dd851095f0e76dabeb9eed487.zip | |
Add timestamp to default log format, invert name and level for better readability, log version once at startup
| -rw-r--r-- | nova/log.py | 10 | ||||
| -rw-r--r-- | nova/service.py | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/nova/log.py b/nova/log.py index 4997d3f28..d021561bb 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' @@ -56,7 +56,7 @@ flags.DEFINE_string('logging_debug_format_suffix', 'data to append to log format when level is DEBUG') flags.DEFINE_string('logging_exception_prefix', - '(%(name)s): TRACE: ', + '%(asctime)s TRACE %(name)s: ', 'prefix each line of exception output with this format') flags.DEFINE_list('default_log_levels', 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) |
