envoy icon indicating copy to clipboard operation
envoy copied to clipboard

Adaptation of the log format of hot-restarter.py to the format of Envoy

Open arminabf opened this issue 9 months ago • 6 comments

Current Behavior:

The hot-restarter.py script logs timestamps with a comma (,) separating seconds from milliseconds.

[2024-05-13 14:03:31,880][1][INFO][hot-restarter.py:210] starting hot-restarter with target: /usr/local/bin/start_envoy.sh
[2024-05-13 14:03:31,880][1][INFO][hot-restarter.py:183] forking and execing new child process at epoch 0
[2024-05-13 14:03:31,881][1][INFO][hot-restarter.py:192] forked new child process with PID=12

In addition, no category ID is output.

Envoy's Format:

Envoy, on the other hand, uses a dot (.) as the separator for milliseconds and outputs a category ID for each log entry.

[2024-05-13 15:25:30.105][12][debug][dns] [source/extensions/network/dns_resolver/cares/dns_impl.cc:369] dns resolution for filebrowser started
[2024-05-13 15:25:30.105][12][trace][dns] [source/extensions/network/dns_resolver/cares/dns_impl.cc:332] Setting DNS resolution timer for 5000 milliseconds
[2024-05-13 15:25:30.108][12][debug][dns] [source/extensions/network/dns_resolver/cares/dns_impl.cc:289] dns resolution for filebrowser completed with status 0

This Pull Request:

This pull request modifies the hot-restarter.py script to align its log format with Envoy's format, using a period (.) as the separator for milliseconds and using the category ID core for all it's log entries. This ensures consistency in post-processing/parsing of log data.

arminabf avatar May 13 '24 15:05 arminabf

Hi @arminabf, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

:cat:

Caused by: https://github.com/envoyproxy/envoy/pull/34116 was opened by arminabf.

see: more, trace.

Thanks, this looks like a good change.

Needs DCO fixed: https://github.com/envoyproxy/envoy/blob/main/CONTRIBUTING.md#fixing-dco

ravenblackx avatar May 14 '24 14:05 ravenblackx

And we prefer to merge onto main not directly onto a release branch.

ravenblackx avatar May 14 '24 14:05 ravenblackx

Thanks, this looks like a good change.

Needs DCO fixed: https://github.com/envoyproxy/envoy/blob/main/CONTRIBUTING.md#fixing-dco

DCO is fixed

arminabf avatar May 14 '24 15:05 arminabf

Can you fix it so it's just the one file change again, against main?

ravenblackx avatar May 14 '24 18:05 ravenblackx

Can you fix it so it's just the one file change again, against main?

it's now one commit against main, is that ok?

arminabf avatar May 15 '24 06:05 arminabf

Yep. Usually force-push is not preferred, but when it's fixing a misbranch it seems appropriate.

ravenblackx avatar May 16 '24 14:05 ravenblackx

@mattklein123 for a quick senior-maintainer pass.

ravenblackx avatar May 16 '24 14:05 ravenblackx