log: JSON timestamps lack timezone info #107

Closed
opened 2026-07-05 14:47:08 +00:00 by the.auditor · 0 comments
Owner

In src/kronai/log.py:32, the JSON timestamp format %Y-%m-%dT%H:%M:%S lacks timezone info, making timestamps ambiguous (local time without offset).

Consider using UTC (time.gmtime) and appending Z for unambiguous ISO 8601 timestamps:

"timestamp": self.formatTime(record, "%Y-%m-%dT%H:%M:%SZ")

And in JSONFormatter.__init__, set self.converter = time.gmtime.

From PR #105 review suggestion.

In `src/kronai/log.py:32`, the JSON timestamp format `%Y-%m-%dT%H:%M:%S` lacks timezone info, making timestamps ambiguous (local time without offset). Consider using UTC (`time.gmtime`) and appending `Z` for unambiguous ISO 8601 timestamps: ```python "timestamp": self.formatTime(record, "%Y-%m-%dT%H:%M:%SZ") ``` And in `JSONFormatter.__init__`, set `self.converter = time.gmtime`. _From PR #105 review suggestion._
fuzzy closed this issue 2026-07-05 17:45:22 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/kronai#107
No description provided.