Logging into IBM(R) Common Logging plugin components supports the existing ILog interfaces as well as the existing RAD LoggingUtil instrumentation. Handlers are provided that will map the existing format records into Common Base Event format. Common Base Event log records will be logged into the Common Logging log file (CommonBaseEvents.xml) in the eclipse\workspace\.metadata directory.
The following table shows the mapping from IStatus to CommonBaseEvent format:
IStatus property | CommonBaseEvent property |
---|---|
Code |
ExtendedDataElement.Name = "Code" ExtendedDataElements.Type = "integer" ExtendedDataElement.Values[0] = <Code> |
Exception |
ExtendedDataElement.Name = "Throwable" ExtendedDataElement.Type = "stringArray" ExtendedDataElement.Values[0] = <Throwable's class name>[: <Throwable's localized message>] ExtendedDataElement.Values[1...n] = <Throwable's stackTraceElement[0...(n - 1)]> [ExtendedDataElement.Children[0] = <Throwable's cause>] where: ExtendedDataElement.Children[0].Name = "Cause"ExtendedDataElement.Children[0].Type = "stringArray" ExtendedDataElement.Children[0].Values[0] = <cause's class name>[: <cause's localized message> ExtendedDataElement.Children[0].Values[1...n] = <cause's stackTraceElement[0...(n - 1)]> [ExtendedDataElement.Children[0].Children[0] = <cause's cause>] |
Message | Msg |
Plugin |
SourceComponentId.Application = "Common Logging" SourceComponentId.Location = <local host's IPv4 IP address> or "127.0.0.1" SourceComponentId.LocationType = "IPV4" SourceComponentId.Component = <Plugin> SourceComponentId.SubComponent = "Log" SourceComponentId.ComponentIDType = "Application" SourceComponentId.ComponetType = "Eclipse Plugins" |
Severity | Severity = <Severity> (see mapping table) |
Children[0...n] | ExtendedDataElement[0...n].Name = <Children<n>.Plugin> ExtendedDataElements[0...n].Type = "string" ExtendedDataElement[0...n].Children[0...m] = <Children<n>.Code> ExtendedDataElement[0...n].Children[0...m] = <Children<n>.Exception> ExtendedDataElement[0...n].Children[0...m] = <Children<n>.Message> ExtendedDataElement[0...n].Children[0...m] = <Children<n>.Severity> ExtendedDataElement[0...n].Children[0...m] = <Children<n>.Children> |
The following CommonBaseEvent properties are automatically populated for each mapping:
CommonBaseEvent property | Value |
---|---|
CreationTime |
Current time in milliseconds |
GlobalInstanceId | Unique GUID |
Situation | Situation.CategoryName = "ReportSituation" Situation.SituationType.ReasoningScope = "INTERNAL" Situation.SituationType.ReportCategory = "LOG/TRACE" |
The following table shows the mapping between the IStatus severity property and CommonBaseEvent's severity property:
IStatus severity | CommonBaseEvent severity |
---|---|
OK |
9 |
INFO | 19 |
WARNING | 49 |
ERROR | 69 |
CANCEL | 70 |
The following table shows the mapping from CommonBaseEvent severities to IStatus severities:
CommonBaseEvent severity range | IStatus severity |
---|---|
0-10 | OK |
11-19 | INFO |
20-49 | WARNING |
50-69 | ERROR |
70 | CANCEL |
The following table shows the mapping from an Exception to CommonBaseEvent properties:
IStatus property | CommonBaseEvent property |
---|---|
Exception |
ExtendedDataElement.Name = "Throwable" ExtendedDataElement.Type = "stringArray" ExtendedDataElement.Values[0] = <Throwable's class name>[: <Throwable's localized message>] ExtendedDataElement.Values[1...n] = <Throwable's stackTraceElement[0...(n - 1)]> [ExtendedDataElement.Children[0] = <Throwable's cause>] where: ExtendedDataElement.Children[0].Name = "Cause"ExtendedDataElement.Children[0].Type = "stringArray" ExtendedDataElement.Children[0].Values[0] = <cause's class name>[: <cause's localized message>] ExtendedDataElement.Children[0].Values[1...n] = <cause's stackTraceElement[0...(n - 1)]> [ExtendedDataElement.Children[0].Children[0] = <cause's cause>] |
Note: Causal Throwables are recursively converted to ExtendedDataElements using the same mapping as above.
(C) Copyright IBM Corporation 2006. All Rights Reserved.