1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright (C) 2021-2022 Nordix Foundation
5 .. DO NOT CHANGE THIS LABEL FOR RELEASE NOTES - EVEN THOUGH IT GIVES A WARNING
19 Default logging level of "logging.level.org.onap.cps" is set to "INFO".
37 "timestamp" : "%timestamp", // 2022-01-28 18:39:17.768
38 "severity": "%level", // DEBUG
39 "service": "${springAppName}", // cps-application
40 "trace": "${TraceId}", // e17da1571e518c59
41 "span": "${SpanId}", // e17da1571e518c59
42 "pid": "${PID}", //11128
43 "thread": "%thread", //tp1901272535-29
44 "class": "%logger{40}", .// o.onap.cps.aop.CpsLoggingAspectService
45 "rest": "%message" // Execution time ...
52 - Curl command 1. Check current log level of "logging.level.org.onap.cps" if it is set to it's default value (INFO)
56 curl --location --request GET 'http://{cps-service-name:cps-management-port}/manage/loggers/org.onap.cps' \
57 --header 'Content-Type: application/json; charset=utf-8'
59 Response body : HTTP Status 200
62 "configuredLevel": "INFO",
63 "effectiveLevel": "INFO"
66 - Curl command 2. Change logging level of "logging.level.org.onap.cps" to "DEBUG"
69 Below-mentioned endpoint will change the log level at runtime. After executing the curl command "effectiveLevel" will set and applied immediately without restarting CPS service.
73 curl --location --request POST 'http://{cps-service-name:cps-management-port}/manage/loggers/org.onap.cps' \
74 --header 'Content-Type: application/json; charset=utf-8' \
76 "configuredLevel": "DEBUG"
79 Response body : HTTP Status 204
81 - Curl command 3. Verify if log level of "logging.level.org.onap.cps" is changed from 'INFO' to 'DEBUG'
85 curl --location --request GET 'http://{cps-service-name:cps-management-port}/manage/loggers/org.onap.cps' \
86 --header 'Content-Type: application/json; charset=utf-8'
88 Response body : HTTP Status 200
91 "configuredLevel": "DEBUG",
92 "effectiveLevel": "DEBUG"
97 By default, Spring Boot will only log to the console and will not write log files.
99 .. image:: images/cps-service-console.JPG
101 :alt: CPS service console
103 Measure Execution Time of CPS Service
104 -------------------------------------
107 Make sure effective log level of "logging.level.org.onap.cps" is 'DEBUG'. This can be verified by executing curl command 3.
109 Execute CPS service that you want to calculate total elapsed time and log as shown below
113 2022-01-28 18:39:17.679 DEBUG [cps-application,e17da1571e518c59,e17da1571e518c59] 11128 --- [tp1901272535-29] o.onap.cps.aop.CpsLoggingAspectService : Execution time of : DataspaceRepository.getByName() with argument[s] = [test42] having result = org.onap.cps.spi.entities.DataspaceEntity@68ded236 :: 205 ms
115 2022-01-28 18:39:17.726 DEBUG [cps-application,e17da1571e518c59,e17da1571e518c59] 11128 --- [tp1901272535-29] o.onap.cps.aop.CpsLoggingAspectService : Execution time of : AnchorRepository.getByDataspaceAndName() with argument[s] = [org.onap.cps.spi.entities.DataspaceEntity@68ded236, bookstore] having result = org.onap.cps.spi.entities.AnchorEntity@71c47fb1 :: 46 ms
117 2022-01-28 18:39:17.768 DEBUG [cps-application,e17da1571e518c59,e17da1571e518c59] 11128 --- [tp1901272535-29] o.onap.cps.aop.CpsLoggingAspectService : Execution time of : CpsAdminPersistenceServiceImpl.getAnchor() with argument[s] = [test42, bookstore] having result = Anchor(name=bookstore, dataspaceName=test42, schemaSetName=bookstore) :: 299 ms
119 2022-01-28 18:39:17.768 DEBUG [cps-application,e17da1571e518c59,e17da1571e518c59] 11128 --- [tp1901272535-29] o.onap.cps.aop.CpsLoggingAspectService : Execution time of : CpsAdminServiceImpl.getAnchor() with argument[s] = [test42, bookstore] having result = Anchor(name=bookstore, dataspaceName=test42, schemaSetName=bookstore) :: 305 ms
121 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 {
123 dataspaceName: test42
124 schemaSetName: bookstore
128 Revert logging level of "logging.level.org.onap.cps" to 'INFO' again to prevent unnecessary logging and impacts on performance.
130 .. Below Label is used by documentation for other CPS components to link here, do not remove even if it gives a warning
131 .. _cps_common_logging:
133 Logging & Diagnostics
134 =====================
138 CPS-Core logs are sent to `STDOUT` in order to leverage the Kubernetes logging architecture.
140 These logs are available using the following command:
144 kubectl logs <cps-core-pod>
146 The default configuration for CPS logs is the INFO level.
148 This architecture also makes all logs ready to be sent to an Elastic-search Log-stash and Kibana (ELK) stack or similar.
150 Enabling tracing for all executed sql statements is done by changing hibernate
153 Logger configuration is provided as a chart resource :
155 +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
156 | cps-component-service-name | logback.xml location |
157 +================================+=================================================================================================================================+
158 | cps-core | `logback.xml <https://github.com/onap/oom/blob/master/kubernetes/cps/components/cps-core/resources/config/logback.xml>`_ |
159 +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
160 | cps-temporal | `logback.xml <https://github.com/onap/oom/blob/master/kubernetes/cps/components/cps-temporal/resources/config/logback.xml>`_ |
161 +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
162 | ncmp-dmi-plugin | Not yet applicable to DMI-Plugin |
163 +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------+
165 .. Below Label is used by documentation for other CPS components to link here, do not remove even if it gives a warning
166 .. _cps_common_monitoring:
170 Once CPS-Core is deployed, information related to the running instance of the application is available
174 http://<cps-component-service-name>:8081/manage/info/
179 Cps-Core health status and state can be checked using the following endpoint.
180 This also includes both the liveliness state and readiness state.
184 http://<cps-component-service-name>:8081/manage/health/
189 Prometheus Metrics can be checked at the following endpoint
193 http://<cps-component-service-name>:8081/manage/prometheus
198 As part of the Jakarta 3.1.0 release, CPS has added validation to the names of the following components:
203 - Cm-Handle identifiers
205 The following characters along with spaces are no longer valid for naming of these components.
209 !"#$%&'()*+,./\:;<=>?@[]^`{|}~