-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
104265: util/log: new config field `format-options`, custom timezones in log output r=Santamaura,abargainier a=knz Fixes #39097. Fixes #88741. This PR introduces a framework to define per-format customization options. See the individual commits for details. # JSON output changes The following options for the `json` format are available: - `datetime-format`: introduce a new `datetime` field - `datetime-timezone`: configure the tz for the new `datetime` field - `fluent-tag`: see format doc - `tag-style`: see format doc Example: ```yaml file-defaults: format: json format-options: { datetime-format: rfc3339, datetime-timezone: America/New_York } ``` Results in entries like this: ```json {...,"timestamp":"1685719746.454267736","datetime":"2023-06-02T11:29:06.454267736-04:00",...} ``` i.e. the `timestamp` field is unchanged for backward-compatibility; a new `datetime` field is introduced alongside it. # Text output format changes Format options are now also supported for `crdb-v1` and `crdb-v2`. In particular, the `timezone` option changes the time zone used to print out the timestamp columns. For example: ```yaml file-defaults: format: crdb-v2 format-options: {timezone: america/new_york} ``` Example logging output: ``` I230606 12:43:01.553407-040000 1 1@cli/start.go:575 ⋮ [n?] 4 soft memory limit of Go runtime is set to 35 GiB ^^^^^^^ indicates GMT-4 was used. ``` See the individual commits and the generated documentation for details. Co-authored-by: Raphael 'kena' Poss <[email protected]>
- Loading branch information
Showing
22 changed files
with
846 additions
and
660 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.