diff options
| author | Kevin L. Mitchell <kevin.mitchell@rackspace.com> | 2011-03-07 23:02:48 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-03-07 23:02:48 +0000 |
| commit | bb4e0c940f49564c740a1863d110106d9018e8d4 (patch) | |
| tree | 6af674d6427d290c1c36f4e6e9d49045ccddfb49 | |
| parent | f5556c7f70778a0ac3c0f2283838d98675e845da (diff) | |
| parent | 7a6daa8d92f4f11fe2fce8fb2f4b11d96cb98c2d (diff) | |
| download | nova-bb4e0c940f49564c740a1863d110106d9018e8d4.tar.gz nova-bb4e0c940f49564c740a1863d110106d9018e8d4.tar.xz nova-bb4e0c940f49564c740a1863d110106d9018e8d4.zip | |
Inhibit inclusion of stack traces in the logs UNLESS --verbose has been specified. This should help keep the logs compact, helping admins find the messages they're interested in (e.g., "Can't connect to MySQL server on '127.0.0.1' (111)") without having to sort through the stack traces, while still allowing developers to see those traces at will.
| -rw-r--r-- | nova/log.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nova/log.py b/nova/log.py index 87a21ddb4..d194ab8f0 100644 --- a/nova/log.py +++ b/nova/log.py @@ -266,7 +266,10 @@ class NovaRootLogger(NovaLogger): def handle_exception(type, value, tb): - logging.root.critical(str(value), exc_info=(type, value, tb)) + extra = {} + if FLAGS.verbose: + extra['exc_info'] = (type, value, tb) + logging.root.critical(str(value), **extra) def reset(): |
