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 8 years ago
- Reactions: 1
- Comments: 29 (11 by maintainers)
For me:
did the trick -
StartLocalin json-formatted access log became trueStartLocal.@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.7in #4954. If you want to test it, check the documentation update in this PR, and try the provided configuration with the imagedduportal/traefik:gh-3870which 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
tzdatais installed (ref. https://github.com/containous/traefik-library-image/blob/master/alpine/Dockerfile#L2). But as you discovered, this files are absent in thescratchimage, hence the need to mount the directory/usr/share/zoneinfo. In both cases, you have to set the environment variableTZto your timezone, so Go will get the right file in the/usr/share/zoneinfodirectory.Same problem here. My host machine is using CEST, yet all access log entries are shown in UTC. Using trafik:1.7 image with: