PEP #: 44
TITLE: Logging Enhancements
Version : 1.1
Authors: Mike Day, Dave Rosckes, Chuck Carmack
State: APPROVED
Approvals Required: Architecture Board or Steering Committee
Type: design
Created: 28/02/03
Version History:
version date
authors
Reason
1.0
28/02/03 (above)
Initial version
1.1
04/03/03 (above)
Initial version
This PEP will not be fully implemented in Pegasus 2.2. Items that will be deferred as labeled as future below. What will be implemented is support for the "flight recorder" through the use of the logLevel configuration property (formally named severity). Additional logging points will be added to the code as needed for flight recording and general error logs. Finally, platform maintainers will be asked to consider adding code to Logger to log to the platform logs.
The current trace facility in Pegasus is useful for programmers to do low-level debug in the field. However, the tracing in Pegasus has some short-comings for use as a service tool:
In the typical service scenario the service engineer will first analyze the log entry recording the failure, then turn on flight recording if needed, and finally turn on debug trace if needed. Customers may want to leave flight recording on, but with the understanding that these log entries will clutter the system log.
Overview of new features:
Proposal 1: Analyze the code and add logging points as needed for flight recording and error logging.
Proposal 2: Remove severity as valid cimconfig property and add logLevel as valid cimconfig property. Implement the logLevel property to control the types of logs created, with the TRACE classification acting as the "flight recorder". This allows customers to control the logging with the cimconfig command. The "flight recorder" logs will be disabled by default. All other log types will be enabled by default.
Proposal 3: Enable platforms to send all log entries, including TRACE, to the system logs where the customers would expect them. (Platform maintainers have the final say of where log entries are sent) Platforms that will support using system logs will define PEGASUS_USE_SYSLOGS. They will need to support the System class abtraction for the syslog calls in Logger, this will remove most of the platform specific code from the Logger. Those platforms not supporting syslogs will continue to use the log file method.
Future: NLS enabling. Log messages must be separated from the source code to allow for translation and internationalization.
More details on these proposals are given below.
TRACE
Information that enables problem solving in the field
INFORMATION
General low-priority nominal events
WARNING
Events that may be a problem or may indication a future problem
SEVERE
Error, serious.
FATAL
Fatal error or event that requires immediate response
This set of classifications is sufficient for Pegasus 2.2. The TRACE classification will be used for the "flight recorder".
In a future release we may expand on these classifications to be more consistent with the Unix syslog classes which are defined below in priority order:
The logLevel property will be used to allow the logging level
to be specified. The log levels are ordered in priority so all logs
with the same or higher priority as the logLevel property will be logged.
For Example:
logLevel=FATAL
-- Log only FATAL errors
logLevel=INFORMATION -- Log INFORMATION,WARNING,SEVERE,FATAL
errors
logLevel=TRACE
-- Log TRACE,INFORMATION,WARNING,SEVERE,FATAL errors
When classifications are added in future releases the user will not be required to change the logLevel to pick up higher priority logs. For Example:
logLevel=SEVERE -- If a classification is added with a higher priority than SEVERE the user will automatically log the new classification.
The default setting for this property will be to enable all log classifications except TRACE.
This will allow the user to indicate what level of logging they need.
The design of log components is TBD at this time. The design is likely to follow the Unix pattern, where the "component" name sent to openlog (ie. the "ident" parm ) is the top-level name of each serviceable part of Pegasus. That is, the main server will be logged as component "CIMServer" to the system logs (ie. ident = "CIMServer"). Providers (serviced separately) will have "ident" component names of their choosing (TBD).
The Logger::put method already has a systemId parameter that maps directly to the "ident" parm on openlog. For this reason, there is no reason to change Logger::put. Current calls to Logger::put will be changed to pass in "CIMServer" on the systemID parm. There will be a const String("CIMServer") declared for internal Pegasus code to use for the systemId.
However, it would be useful for TRACE logs to indicate which internal Pegasus component (Security, Repository, etc) is doing the trace. For this reason, a new Logger::trace( ) method will be added for TRACE logs. This method will have a parameter for the internal Pegasus component id. Calls will be added to Pegasus for TRACE logs, with component id's defined as needed. The component id's will be similiar to the traceComponent id's. However, since this design is not finalized, the log component id will be ignored by the trace method. For the same reason, a logComponent config property will not be exposed in cimconfig.
A tentative list of Pegasus logging components includes the following:
External Logger APIs:
// Existing Logger put API is unchanged , except that the severity
parm is renamed to logLevel.
void Logger::put(
LogFileType logFileType,
const String& systemId,
Uint32 logLevel,
const String&
formatString,
const Formatter::Arg&
arg0,
const Formatter::Arg&
arg1,
const Formatter::Arg&
arg2,
const Formatter::Arg&
arg3,
const Formatter::Arg&
arg4,
const Formatter::Arg&
arg5,
const Formatter::Arg&
arg6,
const Formatter::Arg&
arg7,
const Formatter::Arg&
arg8,
const Formatter::Arg&
arg9);
// New Logger trace API. The logLevel is forced to TRACE
(ie. no parm for this)
void Logger::trace(
LogFileType logFileType,
const String& systemId,
const Uint32 logComponent,
const String&
formatString,
const Formatter::Arg&
arg0,
const Formatter::Arg&
arg1,
const Formatter::Arg&
arg2,
const Formatter::Arg&
arg3,
const Formatter::Arg&
arg4,
const Formatter::Arg&
arg5,
const Formatter::Arg&
arg6,
const Formatter::Arg&
arg7,
const Formatter::Arg&
arg8,
const Formatter::Arg&
arg9);
We are working toward this timeline:
March 14, 2003 - PEP is approved and base code (ie. changes to
Logger) is committed
March 21, 2003 - Finish analysis of code for additional logging
points in Pegasus 2.2.
March 28, 2003 - New logging calls added to the code, tested,
and committed.