Commit 3fe498e
committed
Use absolute timestamp format in JSON logs.
The current log format for the proxy shows the number of seconds since process start. This is fine for most cases, but can make logs processing and aggregation tricky, especially when using the JSON format.
This changes the JSON format to always report the absolute timestamp instead of uptime. The existing format (using uptime in seconds) is preserved in the plain logs format, as it is still useful for debugging and the absolute timestamp can be retrieved using `kubectl logs --timestamp`.
Example output with the env var set:
```json
{"timestamp":"2024-09-09T13:38:56.913847Z","level":"DEBUG","fields":{"message":"Only allowing connections targeting `LINKERD2_PROXY_INBOUND_IPS`","allowed":"{10.42.0.48}"},"target":"linkerd_app::env","threadId":"ThreadId(1)"}
{"timestamp":"2024-09-09T13:38:56.919918Z","level":"INFO","fields":{"message":"Using single-threaded proxy runtime"},"target":"linkerd2_proxy::rt","threadId":"ThreadId(1)"}
```
Fixes [#12505](linkerd/linkerd2#12505)
Signed-off-by: Scott Fleener <[email protected]>1 parent f82de85 commit 3fe498e
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
0 commit comments