bryancall commented on PR #14010: URL: https://github.com/apache/trafficserver/pull/14010#issuecomment-6691479138
Thanks for jumping on this so quickly, and for keeping it to step 1. This is the shape I had in mind: one shared formatter that both the diags and error.log paths call, the old error.log helper removed, rolled file names left alone, and a note in the upgrade guide. I built it on Linux and ran the unit tests and the full end-to-end test suite, and everything passes. On the tests not starting: being a draft isn't what stopped them. For a first pull request, a committer has to start the test runs by hand, so I'll start them for you. ## Needed before it leaves draft **1. A test that checks the log files themselves.** `test_ts_iso8601.cc` covers the formatter well, but nothing would fail if `DbgCtl.cc` or `LogObject.cc` stopped calling it. [connect_down_policy_4.test.yaml](https://github.com/apache/trafficserver/blob/6445b3824a48496e48ba78290217cd11a1916e50/tests/uranium_tests/connect_down_policy/replay/connect_down_policy_4.test.yaml#L61-L63) already checks error.log, so two more rules there would cover both logs: ```yaml log_validation: error_log: gold_file: "gold/connect_down_policy_4_error_log.gold" contains: - expression: '^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z CONNECT' description: error.log lines start with an ISO 8601 UTC stamp diags_log: contains: - expression: '^\[\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z\]\s' description: diags.log lines start with an ISO 8601 UTC stamp ``` I tried exactly this: it fails on master and passes with your change. **2. The page that documents the diags format.** [diagnostic-files.en.rst](https://github.com/apache/trafficserver/blob/6445b3824a48496e48ba78290217cd11a1916e50/doc/admin-guide/monitoring/diagnostic-files.en.rst#L34) still shows `[Oct 13 14:40:46.134] Server {0x2ae95ff5ce80} DIAG: ...`. That's the page people read to learn what these lines look like, so it should show the new stamp and say it is in UTC. A few other pages have sample output in the old form, for example [a-simple-plugin.en.rst](https://github.com/apache/trafficserver/blob/6445b3824a48496e48ba78290217cd11a1916e50/doc/developer-guide/plugins/getting-started/a-simple-plugin.en.rst#L84-L89), [tcpinfo.en.rst](https://github.com/apache/trafficserver/blob/6445b3824a48496e48ba78290217cd11a1916e50/doc/admin-guide/plugins/tcpinfo.en.rst#L160-L165) and [cookie_remap.en.rst](https://github.com/apache/trafficserver/blob/6445b3824a48496e48ba78290217cd11a1916e50/doc/admin-guide/plugins/cookie_remap.en.rst#L461-L464). Updating thos e would be nice, but the diagnostic files page is the one that matters. ## Non-blocking - Keeping plugin text logs on the same format as error.log is the right call, and your upgrade note already says so. No need to limit the change. - In [DbgCtl.cc](https://github.com/apache/trafficserver/blob/6445b3824a48496e48ba78290217cd11a1916e50/src/tsutil/DbgCtl.cc#L306-L310) the parameter is named `ts`, the same as the `ts::` namespace, so the line reads `ts::format_iso8601_utc(ts.ts, ...)`. It works, but renaming the parameter to something like `stamp` would read more easily. - In the [upgrade note](https://github.com/apache/trafficserver/blob/6445b3824a48496e48ba78290217cd11a1916e50/doc/release-notes/upgrading.en.rst#L116-L124) both columns show 18:58:01, which only lines up on a server already set to UTC. A local time that differs, like `[Oct 8 11:58:01.123]` for a server on Pacific time, shows the change better. It would also help to say that rolled log file names still use local time, since the lines inside them are now UTC. - [ts_iso8601.h](https://github.com/apache/trafficserver/blob/6445b3824a48496e48ba78290217cd11a1916e50/include/tsutil/ts_iso8601.h#L43-L44) says it returns 0 for a year outside 0000-9999, but the code only checks that the year prints as four characters, and C libraries differ on that (glibc prints the year 999 as `999`). Either check the year range directly or word the comment to match what the code checks. - The lua and regex_remap plugins print their own timestamps to traffic.out, so a few lines there keep the old style. That's fine to leave for a follow-up. Thanks again, this is a great first pull request. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
