-
Story
-
Resolution: Unresolved
-
Medium
-
None
-
None
-
None
-
None
Up to date table is here:
https://wiki.onap.org/display/DW/Jakarta+Best+Practice+Proposal+for+Standardized+Logging+Fields+-+v2
Sample logging looks like :
2022-01-28 18:39:17.843 DEBUG [cps-application,e17da1571e518c59,e17da1571e518c59] 11128 --- [tp1901272535-29] o.onap.cps.aop.CpsLoggingAspectService : Execution time of :
AdminRestController.getAnchor() with argument[s] = [test42, bookstore] having result = <200 OK OK,class AnchorDetails {
name: bookstore
dataspaceName: test42
schemaSetName: bookstore
},[]> :: 419 ms
Logging pattern is like :
<pattern> { "timestamp" : "%timestamp", // 2022-01-28 18:39:17.84 "severity": "%level", // DEBUG "service": "${springAppName}", // cps-application "trace": "${TraceId}", // e17da1571e518c59"span": "${SpanId}", // e17da1571e518c59"pid": "${PID}", //11128 "thread": "%thread", //tp1901272535-29 "class": "%logger{40}", // o.onap.cps.aop.CpsLoggingAspectService "rest": "%message" // Execution time ... } </pattern>
Current progress on the GREEN Field for CPS
Field Name | Description | CPS logging Field |
Timestamp | The container and container application MUST log the field “date/time” in the security audit logs. 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”. |
|
Log Type Name | The container and container application MAY log the field "Log type" in security audit logs. This field will adhere to the following ENUM ::= "AUDIT" | "METRICS" | "ERROR" | "DEBUG" | "" This is here for legacy purposes. Older projects used to generate 4 separate log files. However since projects now will output all logs to STDOUT and STDERR this field is here to give projects adhering to the old standard a way to specify those log file types. NOTE: This field is optional but a placeholder is still required to be outputted. That is why the "" is included in the ENUM. |
|
Log Level | The container and container application MUST use an appropriately configured logging level that can be changed dynamically. The intention of this field is to not cause performance degradation via excessive logging. This field will adhere to the following ENUM ::= "FATAL" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE" The verbosity of the logging increases from left to right. |
|
Trace ID | The container and container application MUST log Trace ID A trace ID is a universally unique value that identifies a single transaction request or a series of related log events within the ONAP platform. Its value is conformant to RFC4122 UUID. This value is readily and easily obtained in most programming environments. |
|
Status Code | The container and container application MUST log a "status code" in the security audit logs. This field indicates the high level status for transactional, APIs calls, or sub operational events. This field will adhere to the following ENUM ::= "SUCCESS" | "INPROGRESS" |"FAIL_WARN" | "FAIL_ERROR" | "FAIL_FATAL" |
Principal ID | The container and container application MUST log the Principal identity of a requestor in the security audit logs. This field should contain the identification of the entity (user agent, client id, user, user id, login ID, non-person entity (NPE), Token, etc.) that made the request of the service or API indicated in the Service/Program Name field. For a serving API that is authenticating the request, this should be the authenticated username or equivalent. NOTE: The CPS project uses a framework that provides this field. |
|
Service / Program Name | The container and container application MUST log the field “service or program used for access” in the security audit logs. This intention is to capture the service name endpoint or an externally advertised API invoked, e.g., where are you connecting to. This is represented as a URI or URL. NOTE: The CPS project uses a framework that provides this field. |
|
Log Message | The container and container application MUST log the field “service or program used for access” in the security audit logs. This intention is to capture the service name endpoint or an externally advertised API invoked, e.g., where are you connecting to. This is represented as a URI or URL. NOTE: The CPS project uses a framework that provides this field. |
Two questions that came out of a meeting :
- Log format
- The position of the fields.
Note : It was discussed that CSV may be a format to standardize on which then mean the position of the fields is very important.