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

Allow setting (access) log timezone directly #959

Open
2 tasks done
jnoordsij opened this issue Nov 7, 2023 · 3 comments
Open
2 tasks done

Allow setting (access) log timezone directly #959

jnoordsij opened this issue Nov 7, 2023 · 3 comments
Labels
good first issue Good for newcomers kind/enhancement New feature or request

Comments

@jnoordsij
Copy link
Collaborator

Welcome!

  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've searched similar issues on the Traefik community forum and didn't find any.

What did you expect to see?

Currently, to allow setting a custom timezone for (access) logs, one needs to alter the following chart values (see also https://doc.traefik.io/traefik/observability/access-logs/#time-zones):

  1. Pass an additional env parameter TZ=US/Alaska, i.e. in terms of values (see also Allow extending env value more easily #958):
  env:
    - name: POD_NAME
      valueFrom:
        fieldRef:
          fieldPath: metadata.name
    - name: POD_NAMESPACE
      valueFrom:
        fieldRef:
          fieldPath: metadata.namespace
    - name: TZ
      value: US/Alaska
  1. Drop the StartUTC field, i.e. in terms of values:
  logs:
    access:
      fields:
        general:
          names:
            # see https://doc.traefik.io/traefik/observability/access-logs/#time-zones
            StartUTC: drop

It would be nice to add a new chart value, e.g. timezone, that would both of these things at once without further changes.

@mloiseleur
Copy link
Contributor

It's not mandatory. One can have StartLocal field without dropping StartUTC.
It's detailed in this blog post on logging.

@jnoordsij
Copy link
Collaborator Author

Ah I see, I only looked at the docs and it wasn't mentioned there, but I understand with json formatting it behaves differently.

Still I think the approach suggested above makes some sense as a "default" convenience option for people, to allow them to easily change timezones without having to fully understand all logging concepts and chart values. Though given that it probably will be used by a limited amount of people, the docs are probably extensive enough at this point (or maybe we can add it here as a little example to the examples doc?).

@mloiseleur
Copy link
Contributor

Sure, why not.
Your PRs are more than welcome :)

@mloiseleur mloiseleur added the good first issue Good for newcomers label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants