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