5d9aac82895b2ad68d8d021718593db5fbafa33b
[oom/platform/cert-service.git] / docs / sections / logging.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2020 NOKIA
4
5 Logging
6 =======
7
8 Certification Service API 
9 --------------------------
10 To see console Certification Service logs use:
11
12 - Docker:
13
14 .. code-block:: bash
15
16    docker logs <cert-service-container-name>
17
18 - Kubernetes:
19
20 .. code-block:: bash
21
22    kubectl logs <cert-service-pod-name>
23
24 Console logs contain logs for logging levels from **DEBUG** to **ERROR**.
25
26 Certification Service logs for different logging levels are available in the container:
27
28 - Docker:
29
30 .. code-block:: bash
31
32     docker exec -it <cert-service-container-name> bash
33
34 - Kubernetes:
35
36 .. code-block:: bash
37
38     kubectl exec -it <cert-service-pod-name> bash
39
40 Path to logs:
41
42     /var/log/onap/aaf/certservice
43
44 Available log files:
45
46     - audit.log - contains logs for **INFO** logging level
47     - debug.log - contains logs for logging levels from **DEBUG** to **ERROR**
48     - error.log - contains logs for **ERROR** logging level
49
50 User cannot change logging levels.
51
52
53 Certification Service Client
54 ----------------------------
55 To see console Certification Service Client logs use :
56
57 - Docker: 
58
59 .. code-block:: bash
60    
61    docker logs <cert-service-client-container-name>
62
63 - Kubernetes: 
64   CertService Client is used as init container in other components. In the following example:
65     - *<some-component-pod-name>* refers to the component that uses CertService Client as init container
66     - *<cert-service-client-init-container-name>* refers to name of init container used by the mentioned component. It can be found by executing *'kubectl descrine pod <some-component-pod-name>'* and looking into 'Init Containers section'
67
68 .. code-block:: bash
69
70    kubectl logs <some-component-pod-name> -c <cert-service-client-init-container-name>
71
72
73
74 | Container stops after execution, so all logs available are printed to console.
75 | User cannot change logging levels.
76
77 Client application exits with following exit codes:
78
79
80 +-------+------------------------------------------------+
81 | Code  | Information                                    |
82 +=======+================================================+
83 | 0     | Success                                        |
84 +-------+------------------------------------------------+
85 | 1     | Invalid client configuration                   |
86 +-------+------------------------------------------------+
87 | 2     | Invalid CSR configuration                      |
88 +-------+------------------------------------------------+
89 | 3     | Fail in key pair generation                    |
90 +-------+------------------------------------------------+
91 | 4     | Fail in CSR generation                         |
92 +-------+------------------------------------------------+
93 | 5     | CertService HTTP unsuccessful response         |
94 +-------+------------------------------------------------+
95 | 6     | Internal HTTP Client connection problem        |
96 +-------+------------------------------------------------+
97 | 7     | Fail in PKCS12 conversion                      |
98 +-------+------------------------------------------------+
99 | 8     | Fail in Private Key to PEM Encoding            |
100 +-------+------------------------------------------------+
101 | 9     | Wrong TLS configuration                        |
102 +-------+------------------------------------------------+