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