You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The log function accepts a timestamp param which, if not provided, will get automatically populated with a UTC-based timestamp of the current time (via the datetime2rfc3339 function). If, however, the user provides this param with a datetime object, then any attached tzinfo is ignored, and that object is only correctly handled if the timestamp is in the recent past (less than 30 minutes ago).
If one provides a timestamp which is further in the past than a half hour from the current time, then an incorrect timezone offset is calculated, effectively making the timestamp itself incorrect in the resulting syslog message header.
If one replaces the contents of datetime2rfc3339 with return dt.isoformat(), I believe this will always produce a valid syslog timestamp (compared against the RFC document).
The text was updated successfully, but these errors were encountered:
The
log
function accepts atimestamp
param which, if not provided, will get automatically populated with a UTC-based timestamp of the current time (via thedatetime2rfc3339
function). If, however, the user provides this param with a datetime object, then any attached tzinfo is ignored, and that object is only correctly handled if the timestamp is in the recent past (less than 30 minutes ago).If one provides a timestamp which is further in the past than a half hour from the current time, then an incorrect timezone offset is calculated, effectively making the timestamp itself incorrect in the resulting syslog message header.
If one replaces the contents of
datetime2rfc3339
withreturn dt.isoformat()
, I believe this will always produce a valid syslog timestamp (compared against the RFC document).The text was updated successfully, but these errors were encountered: