...
- Events that are written by ONAP components.
- Propagation of transaction and other invocation information between components.
- MDCs, Markers and other information that should be attached to log messages.
- Human- and machine-readable output format(s).
- Files, locations and other conventions.
...
The purpose of ONAP logging is to capture information needed to operate, troubleshoot and report on the performance of the ONAP platform and its constituent components. Log records may be viewed and consumed directly by users and systems, indexed and loaded into a databasedatastore, and used to compute metrics and KPIsgenerate reports.
The processing of a single client request will often involve multiple ONAP components and/or their subcomponents (interchangeably referred to as ‘application’ in this document). The ability to track such processing flows across components is critical to understanding ONAP’s behavior and performance. ONAP logging uses a universally unique RequestID value in log records to track the processing of every client request through all the ONAP components involved in its processing.
A reference configuration of Elastic Stack can be deployed using ONAP Operations Manager.
This document gives conventions you can follow to generate conformant, indexable logging output from your component.
How to Log
ONAP prescribes conventions, and while it encourages the . The use of certain APIs and providers is recommended, but they are not mandatory. Most components log via EELF or SLF4J to a provider like Logback or Log4j.
EELF
EELF is the Event and Error Logging Framework, described at https://github.com/att/EELF.
...
EELF is a facade, so logging output is configured in two ways:
- By selection of a Providerlogging provider such as Logback or Log4j, typically via the classpath.
- By way of a Provider provider configuration document, typically logback.xml or log4j.xml. See Providers.
SLF4J
SLF4J is a logging facade, and a humble masterpiece. It combines what's common to all major, modern Java logging providers into a single interface. This decouples the caller from the provider, and encourages them to the use only of what's universal, familiar and proven.
...
Providers are normally enabled by their presence in the classpath. This means the decision may already have been made for you, in some cases implicitly by dependencies. If you have a strong preference then you can change providers, but since the implementation is typically abstracted behind EELF or SLF4J, it may not be worth the effort.
...
Certain MDCs and their semantics may be specific to EELF log types.
MDC | Description | Required | EELF Audit | EELF Metric | EELF Error | EELF Debug |
---|---|---|---|---|---|---|
BeginTimestamp | Date-time that processing activities being logged begins. The value should be represented in UTC and formatted per ISO 8601, such as “2015-06-03T13:21:58+00:00”. The time should be shown with the maximum resolution available to the logging component (e.g., milliseconds, microseconds) by including the appropriate number of decimal digits. For example, when millisecond precision is available, the date-time value would be presented as, as “2015-06-03T13:21:58.340+00:00”. | Y | ||||
EndTimestamp | Date-time that processing for the request or event being logged ends. Formatting rules are the same as for the BeginTimestamp field above. In the case of a request that merely logs an event and has not subsequent processing, the EndTimestamp value may equal the BeginTimestamp value. | Y | ||||
ElapsedTime | This field contains the elapsed time to complete processing of an API call or transaction request (e.g., processing of a message that was received). This value should be the difference between. EndTimestamp and BeginTimestamp fields and must be expressed in milliseconds. | Y | ||||
ServiceInstanceID | This field is optional and should only be included if the information is readily available to the logging component. Transaction requests that create or operate on a particular instance of a service/resource can
NOTE: AAI won’t have a serviceInstanceUUID for every service instance. For example, no serviceInstanceUUID is available when the request is coming from an application that may import inventory data. | |||||
VirtualServerName | Physical/virtual server name. Optional: empty if determined that its value can be added by the agent that collects the log files collecting. | |||||
ServiceName | For Audit log records that capture API requests, this field contains the name of the API invoked at the component creating the record (e.g., Layer3ServiceActivateRequest). For Audit log records that capture processing as a result of receipt of a message, this field should contain the name of the module that processes the message. | |||||
PartnerName | This field contains the name of the client application user agent or user invoking the API if known. | |||||
StatusCode | This field indicates the high level status of the request. It must have the value COMPLETE when the request is successful and ERROR when there is a failure. | |||||
ResponseCode | This field contains application-specific error codes. For consistency, common error categorizations should be used. | |||||
ResponseDescription | This field contains a human readable description of the ResponseCode. | |||||
InstanceUUID | If known, this field contains a universally unique identifier used to differentiate between multiple instances of the same (named) log writing service/application. Its value is set at instance creation time (and read by it, e.g., at start/initialization time from the environment). This value should be picked up by the component instance from its configuration file and subsequently used to enable differentiation of log records created by multiple, locally load balanced ONAP component or subcomponent instances that are otherwise identically configured. | |||||
Severity | Optional: 0, 1, 2, 3 see Nagios monitoring/alerting for specifics/details. | |||||
TargetEntity | It contains the name of the ONAP component or sub-component, or external entity, at which the operation activities captured in this metrics log record is invoked. | Y | ||||
TargetServiceName | It contains the name of the API or operation activities invoked at the TargetEntity. | Y | ||||
Server | This field contains the Virtual Machine (VM) Fully Qualified Domain Name (FQDN) if the server is virtualized. Otherwise, it contains the host name of the logging component. | |||||
ServerIPAddress | This field contains the logging component host server’s IP address if known (e.g. Jetty container’s listening IP address). Otherwise it is empty. | |||||
ServerFQDN | Unclear, but possibly duplicating one or both of Server and ServerIPAddress. | |||||
ClientIPAddress | This field contains the requesting remote client application’s IP address if known. Otherwise this field can be empty. | |||||
ProcessKey | This field can be used to capture the flow of a transaction through the system by indicating the components and operations involved in processing. If present, it can be denoted by a comma separated list of components and applications. | |||||
RemoteHost | Unknown. | |||||
AlertSeverity | Unknown. | |||||
TargetVirtualEntity | Unknown | |||||
ClassName | Defunct. Doesn't require an MDC. | |||||
ThreadID | Defunct. Doesn't require an MDC. | |||||
CustomField1 | (Defunct now that MDCs are serialized as NVPs.) | |||||
CustomField2 | (Defunct now that MDCs are serialized as NVPs.) | |||||
CustomField3 | (Defunct now that MDCs are serialized as NVPs.) | |||||
CustomField4 | (Defunct now that MDCs are serialized as NVPs.) |
Markers
Markers differ from MDCs in two important ways:
...