Closed hangy closed 3 years ago
Right now, the timestamp used to write to Splunk is created by the HttpEventCollectorEventInfo constructor with DateTime.UtcNow because of the overload used here https://github.com/AlanBarber/NLog.Targets.Splunk/blob/fa0ceb2a1008f888b55476008db76a53651f844b/src/NLog.Targets.Splunk/SplunkHttpEventCollector.cs#L250
HttpEventCollectorEventInfo
DateTime.UtcNow
NLog seems to provide the actual timestamp of the log event in LogEventInfo.TimeStamp: https://github.com/NLog/NLog/blob/v4.7.7/src/NLog/LogEventInfo.cs#L169 This can provide higher accuracy timestamps of the time source configured in NLog, and would result in the same timestamp logged in all sources.
LogEventInfo.TimeStamp
Is there a specific reason why this not done right now? It can probably be changed by adding logEventInfo.TimeStamp as the first parameter to Send and checking that datetime is of the UTC kind in the HttpEventCollectorEventInfo ctor.
logEventInfo.TimeStamp
Send
datetime
Right now, the timestamp used to write to Splunk is created by the
HttpEventCollectorEventInfo
constructor withDateTime.UtcNow
because of the overload used here https://github.com/AlanBarber/NLog.Targets.Splunk/blob/fa0ceb2a1008f888b55476008db76a53651f844b/src/NLog.Targets.Splunk/SplunkHttpEventCollector.cs#L250NLog seems to provide the actual timestamp of the log event in
LogEventInfo.TimeStamp
: https://github.com/NLog/NLog/blob/v4.7.7/src/NLog/LogEventInfo.cs#L169 This can provide higher accuracy timestamps of the time source configured in NLog, and would result in the same timestamp logged in all sources.Is there a specific reason why this not done right now? It can probably be changed by adding
logEventInfo.TimeStamp
as the first parameter toSend
and checking thatdatetime
is of the UTC kind in theHttpEventCollectorEventInfo
ctor.