Skip to content
This repository was archived by the owner on Dec 21, 2024. It is now read-only.

Conversation

@lalten
Copy link
Contributor

@lalten lalten commented May 5, 2020

The "timestamp" field does not contain timezone information. If you don't live in GMT, that is probably wrong for you. This PR adds an additional "+000" to the serialized datetime.
Also, it uses the log creation timestamp, not whatever time it is when the field gets added.

Before this commit, when a JsonFormatter is created with the timestamp=
True parameter, it used utcnow(). Which is not time when the log record
was created, but when the field was added. Also, utcnow is not timezone
aware, so the serialized datetime is missing the timezone designator at
the end.  This commit uses the time at which the log record was created
and sets the timezone to UTC, which results in an additional "+000" end
@madzak madzak merged commit b3dbb51 into madzak:master Sep 26, 2020
@madzak
Copy link
Owner

madzak commented Sep 26, 2020

Thanks for this and sorry for the HUGE delay!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants