envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
24.86k stars 4.78k forks source link

Customised time-zone format support for Envoy Proxy logs #23260

Open slahirucd7 opened 2 years ago

slahirucd7 commented 2 years ago

Title: Enable envoy proxy to provide logs in customised (user preferred time zone format)

Description:

Currently Envoy proxy supports UTC time format and the ISO 8601 time zone format only. Users of the envoy proxy cannot obtain the logs in their preferred time zone format. This becomes a necessary and important feature when we are using the Envoy Proxy with other components. (Ex: another component to handle HTTP request authentication and it supports logs in our preferred time zone format. In this case the logs in there will be in the relevant time zone format and Envoy proxy related logs will be in the UTC or ISO 8601 format. When there's a particular incident(s) to be recognised, it is very difficult since logs are in different formats).

Even though envoy is capable to provide logs in ISO 8601 format the outcome will be something similar to 05:02:25+08:00. Users will consume lot of time to recognise logs relevant to the incident.

Therefore, is there an ongoing plan to enable support for the above mentioned use case ? if not can we contribute to provide support for the above feature ?

Since this massively improves readability of the envoy proxy logs update regarding the above is highly appreciated.

[optional Relevant Links:] https://github.com/envoyproxy/envoy/issues/3546

yanavlasov commented 2 years ago

@snowp @dio for any comments

dio commented 2 years ago

Not sure about this, but from @mattklein123 https://github.com/envoyproxy/envoy/issues/3546#issuecomment-394786436, seems like it is not planned :). Would love to see Matt's opinion on this too.

mattklein123 commented 2 years ago

I still do not recommend writing access logs in anything other than UTC, but I don't have an objection to someone doing the work to make it customizable, so we can mark this help wanted.

doujiang24 commented 4 months ago

seems it's hard to customize format string, new command operators might be better. how about introduce %START_TIME_LOCAL% and %EMIT_TIME_LOCAL%?

@mattklein123 @dio WDYT?