Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR #104265 - util/log: timezone support for formats crdb-v1 and crdb-v2 (1 of 3) #17271

Closed
cockroach-teamcity opened this issue Jun 15, 2023 · 1 comment

Comments

@cockroach-teamcity
Copy link
Member

cockroach-teamcity commented Jun 15, 2023

Exalate commented:

Related PR: cockroachdb/cockroach#104265
Commit: cockroachdb/cockroach@d756dec
Fixes: CRDB-5594 CRDB-19901


Release note (cli change): The log output formats crdb-v1 and
crdb-v2 now support the format option timezone. When specified,
the corresponding time zone is used to produce the timestamp column.

For example:

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.

The timezone offset is also always included in the format if it is not
zero (e.g. for non-UTC time zones). This is necessary to ensure that
the times can be read back precisely.

Jira Issue: DOC-8104

Copy link

Florence Morris (florence-crl) commented:
{noformat}I231031 14:30:55.080259+000000 1 1@cli/log_flags.go:200 ⋮ [n?] 1 using explicit logging configuration:
I231031 14:30:55.080259+000000 1 1@cli/log_flags.go:200 ⋮ [n?] 1 +‹file-defaults:›
I231031 14:30:55.080259+000000 1 1@cli/log_flags.go:200 ⋮ [n?] 1 +‹ format: crdb-v2›
I231031 14:30:55.080259+000000 1 1@cli/log_flags.go:200 ⋮ [n?] 1 +‹ format-options: {timezone: etc/utc}›{noformat}

The timezone offset of zero is included if the timezone {{etc/utc}} is specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants