Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timestamp seems to be calculated incorrectly #17

Closed
eppyjerk opened this issue Sep 27, 2017 · 1 comment
Closed

Timestamp seems to be calculated incorrectly #17

eppyjerk opened this issue Sep 27, 2017 · 1 comment

Comments

@eppyjerk
Copy link

https://github.com/whir1/serilog-sinks-graylog/blob/73e34c0e2827062fa9936dadf77657e3a17def71/src/Serilog.Sinks.Graylog/MessageBuilders/GelfMessageBuilder.cs#L36

This should be using .UtcDateTime instead of .DateTime. DateTime will return an "Unspecified" Kind of of DateTime which when converted using .ToUniversalTime() (on Line 53), it will use the local time zone to convert to Utc. Calling .UtcDateTime from the original DateTimeOffset value on logEvent.Timestamp, we are guaranteed to get the proper Utc date.

@eppyjerk
Copy link
Author

eppyjerk commented Oct 3, 2017

After further review, I believe this to be unnecessary.

@eppyjerk eppyjerk closed this as completed Oct 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant