From db9ee1782c1a36add33a16c3a086e10eef11d6cd Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Tue, 6 Jan 2015 10:07:40 -0500 Subject: [PATCH] Add TRACE definition to log guidelines We should consider actually using the TRACE keyword for logging as something meaningful. Today TRACE is used as a prefix for stack traces even though it has no logging level definition. This would provide a deep debug level which many developers have requested. TRACE is a standard level in other logging systems such as: https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html and means what we are proposing here. This means that 3rd party tools are highly likely to understand this meaning for TRACE (and actually be terribly confused by the current OpenStack use of TRACE). Co-Authored-By: Alexis Lee Change-Id: Iba69bb07e4c6fd5232efa20b984042a30c85e58b --- specs/log-guidelines.rst | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/specs/log-guidelines.rst b/specs/log-guidelines.rst index 291b760..da3052f 100644 --- a/specs/log-guidelines.rst +++ b/specs/log-guidelines.rst @@ -67,7 +67,13 @@ be interpreted): not be so verbose as to overwhelm real signal with noise. Should not be continuous "I'm alive!" messages. - Debug: developer logging level, only enable if you are interested in - reading through a ton of additional information about what is going on. + reading through a ton of additional information about what is going + on. +- Trace: In functions which support this level, details every + parameter and operation to help diagnose subtle bugs. This should + only be enabled for specific areas of interest or the log volume + will be overwhelming. Some system performance degradation should be + expected. Proposed Changes From Status Quo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -82,6 +88,19 @@ Information that was previously being emitted at AUDIT should instead be sent as notifications to a notification queue. *Note: Notification formats and frequency are beyond the scope of this spec.* +- Define TRACE logging level + +TRACE is a logging keyword that is understood by most logging +tools. OpenStack has repurposed this in the past to not be TRACE +logging but instead be used whenever a Stacktrace was dumped. + +Stack traces should be logged at ERROR level (they currently +aren't). + +TRACE should be defined as log level 5 in python (which is lower than +DEBUG), and LOG.trace support should be added to oslo +logger. LOG.trace can then be used for deep tracing of code. + Overall Logging Rules --------------------- The following principles should apply to all messages @@ -382,3 +401,5 @@ References https://wiki.openstack.org/wiki/Security/Guidelines/logging_guidelines - Wiki page for basic logging standards proposal developed early in Icehouse - https://wiki.openstack.org/wiki/LoggingStandards +- Apache Log4j levels (which many tools work with) - + https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html