testkube icon indicating copy to clipboard operation
testkube copied to clipboard

Make all logs consistent

Open exu opened this issue 2 years ago • 0 comments

Describe the enhancement you'd like to see

Currently all logs looks like from different systems

Use JSON logging for all possible logging outputs.

example:

Available migrations for v1.3.0
No migrations available for v1.3.0
{"level":"warn","ts":1657104355.4716427,"caller":"api-server/main.go:105","msg":"Getting uniqe clusterId","error":null}
{"level":"info","ts":1657104355.5050254,"caller":"v1/server.go:279","msg":"Testkube API configured","namespace":"testkube","clusterId":"clusterbb669eef1b556e914a11107ae51ccfa9","telemetry":false}
segment 2022/07/06 10:45:55 ERROR: sending request - Post "https://api.segment.io/v1/batch": read tcp 172.17.0.37:40666->35.155.223.175:443: read: connection reset by peer
segment 2022/07/06 10:45:55 ERROR: 1 messages dropped because they failed to be sent and the client was closed
{"level":"info","ts":1657104355.5379503,"caller":"api-server/main.go:130","msg":"starting Testkube API server","telemetryEnabled":true,"clusterId":"clusterbb669eef1b556e914a11107ae51ccfa9","namespace":"testkube"}

 ┌───────────────────────────────────────────────────┐
 │                   Fiber v2.31.0                   │
 │               http://127.0.0.1:8088               │
 │       (bound on host 0.0.0.0 and port 8088)       │
 │                                                   │
 │ Handlers ........... 166  Processes ........... 1 │
 │ Prefork ....... Disabled  PID ................. 1 │
 └───────────────────────────────────────────────────┘

segment 2022/07/06 10:45:55 ERROR: sending request - Post "https://api.segment.io/v1/batch": read tcp 172.17.0.37:32808->52.34.77.50:443: read: connection reset by peer
segment 2022/07/06 10:45:55 ERROR: 1 messages dropped because they failed to be sent and the client was closed
segment 2022/07/06 11:45:55 ERROR: sending request - Post "https://api.segment.io/v1/batch": EOF
segment 2022/07/06 11:45:55 ERROR: 1 messages dropped because they failed to be sent and the client was closed
segment 2022/07/06 12:45:55 ERROR: sending request - Post "https://api.segment.io/v1/batch": EOF
segment 2022/07/06 12:45:55 ERROR: 1 messages dropped because they failed to be sent and the client was closed
segment 2022/07/06 13:45:55 ERROR: sending request - Post "https://api.segment.io/v1/batch": EOF
segment 2022/07/06 13:45:55 ERROR: 1 messages dropped because they failed to be sent and the client was closed
segment 2022/07/06 14:45:55 ERROR: sending request - Post "https://api.segment.io/v1/batch": EOF
segment 2022/07/06 14:45:55 ERROR: 1 messages dropped because they failed to be sent and the client was closed
segment 2022/07/06 15:45:55 ERROR: sending request - Post "https://api.segment.io/v1/batch": EOF
segment 2022/07/06 15:45:55 ERROR: 1 messages dropped because they failed to be sent and the client was closed
segment 2022/07/06 16:45:55 ERROR: sending request - Post "https://api.segment.io/v1/batch": EOF
segment 2022/07/06 16:45:55 ERROR: 1 messages dropped because they failed to be sent and the client was closed
segment 2022/07/06 17:45:55 ERROR: sending request - Post "https://api.segment.io/v1/batch": EOF
segment 2022/07/06 17:45:55 ERROR: 1 messages dropped because they failed to be sent and the client was closed
segment 2022/07/06 18:45:55 ERROR: sending request - Post "https://api.segment.io/v1/batch": EOF
segment 2022/07/06 18:45:55 ERROR: 1 messages dropped because they failed to be sent and the client was closed
segment 2022/07/06 19:45:55 ERROR: sending request - Post "https://api.segment.io/v1/batch": read tcp 172.17.0.37:44758->44.241.139.196:443: read: connection reset by peer
segment 2022/07/06 19:45:55 ERROR: 1 messages dropped because they failed to be sent and the client was closed
< Ommiting same error logs>

exu avatar Jul 07 '22 07:07 exu