traefik: Traefik log can't switch the timezone
Do you want to request a feature or report a bug?
Feature
What did you expect to see?
In my case, I wonder if I can switch the time zone to use the local time, and the traefik log and access log will make more sense and easier to understand
But I search over the traefik official document or github issues, i cant find any options to achieve it
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 29 (11 by maintainers)
For me:
did the trick -
StartLocal
in json-formatted access log became trueStartLocal
.Thanks @natlibfi-arlehiko @mbleichner . The feature had been merged on the
v1.7
branch of the project. We have to wait for the next 1.7.x release (no ETA yet).Until then, you might want to use the image
containous/traefik:experimental-v1.7
which is built from thev1.7
branch, hence contains the fix.@dduportal Works!
Hi @mbleichner @natlibfi-arlehiko ,
Thanks to @ldez good ideas, we’ve tried a tiny fix that might be non breaking and such integrated in the
v1.7
in #4954. If you want to test it, check the documentation update in this PR, and try the provided configuration with the imagedduportal/traefik:gh-3870
which contains the fix.A side note: the Traefik image based on Alpine should not require to mount your host local’s timezone, as the package
tzdata
is installed (ref. https://github.com/containous/traefik-library-image/blob/master/alpine/Dockerfile#L2). But as you discovered, this files are absent in thescratch
image, hence the need to mount the directory/usr/share/zoneinfo
. In both cases, you have to set the environment variableTZ
to your timezone, so Go will get the right file in the/usr/share/zoneinfo
directory.Same problem here. My host machine is using CEST, yet all access log entries are shown in UTC. Using trafik:1.7 image with: