mirror of
https://github.com/lldap/lldap.git
synced 2026-04-25 00:05:50 +03:00
[GH-ISSUE #1290] [BUG] (Docker) Logs not respecting the Timezone #450
Labels
No labels
backend
blocked
bug
cleanup
dependencies
docker
documentation
duplicate
enhancement
enhancement
frontend
github_actions
good first issue
help wanted
help wanted
integration
invalid
ldap
pull-request
question
rust
rust
tests
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/lldap-lldap#450
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vic1707 on GitHub (Sep 15, 2025).
Original GitHub issue: https://github.com/lldap/lldap/issues/1290
Describe the bug
The docker logs don't respect the timezone passed as a direct file or as the TZ env.
To Reproduce
The timezone is successfully detected when using either a volume mount or the TZ env
But when running the lldap container itself, the logs don't respect the timezone
Expected behavior
The time and date in the logs should reflect the desired Timezone
Logs
ENV with verbose mode (doesn't seem to change anything)
@nitnelave commented on GitHub (Sep 15, 2025):
For simplicity and making things easier to debug, all the times are in UTC. I don't think I want to change that
@vic1707 commented on GitHub (Sep 15, 2025):
While UTC can simplify your debugging, most users don’t actually live in UTC. When apps ignore the configured timezone, it creates unnecessary friction in real deployments (imagine having your services all in UTC but one insists on UTC-4).
For debugging, it may be enough to ask users to state their timezone (it’s usually already in a docker run or docker-compose snippet). That way the info is clear to the maintainers, but users can still run services in their local timezone.
@nitnelave commented on GitHub (Sep 15, 2025):
It's not so much that I want to know when you run each query (I don't care what time zone you're in), but rather that the system manipulates timestamps in UTC all over the place (e.g. creation date) and I want consistent times with the logs time.
Having only half of the timestamps be local is the worst possible outcome, and trying to determine where and when to do the correct conversions for display is unnecessary complexity that I don't want to add to the project.
The timestamps are converted to the users' local timezones in the web UI.
@vic1707 commented on GitHub (Sep 15, 2025):
Ok, thanks for the clarification, I better understand what you meant.
Wouldn't it be better if lldap used the system's timezone everywhere on boot ?
This feels way more natural and takes care of the consistency while being way more convenient for end users, doesn't it ?
Imo an app running somewhere shouldn't really care about what timezone it's on, it should just use it transparently, but I can very well be mistaken.
I didn't look into the code yet so I have no real clue of the amount of work/side effects this could have.
Tho, what could become scary would be migrations ie: users noticing the change and wanting to go to their timezones 🤔
@nitnelave commented on GitHub (Sep 15, 2025):
Timezones for anything else than display is rife with issues. DST is probably the most well known :)
Of course, what you'd want is a monotonic time (seconds since epoch) associated with a timezone for interpretation. But then, every operation except for displaying can be done on the monotonic time instead. And you wouldn't want to store the timezone in the DB, what if you run 2 instances of LLDAP in different timezones? So you end up using the monotonic time instead (UTC), and converting it as late as possible to a user-friendly format for displaying.
In your ideal world, the conversion would be before logging, but that infects the code in lots of places. In my ideal world, it's only done in the frontend :)
@vic1707 commented on GitHub (Sep 15, 2025):
Yeah having two instances with potentially different timezones would be a receipt for disaster 😅.
I 100% agree with you that time should be stored in UTC, sorry if my previous messages implied the opposite 🙇.
The same way nobody cares about my specific timezone, I think not a single user really cares about what is stored, it's an implementation detail.
I do prefer the world view you depicted, I think the difference lies in me believing that app logs are part of the "frontend" 😉
@nitnelave commented on GitHub (Sep 15, 2025):
The short of it is that if there's a way to have your cake (timezone logs) and I can eat it too (almost no added code complexity) I would probably accept it. But I probably won't be looking for it.
@vic1707 commented on GitHub (Sep 16, 2025):
Ok, I'll try looking for that then 👍