Always use a tz aware timestamp

* https://sonarcloud.io/project/issues?open=AZDmRade2PiUXMD3dXnx&id=ansible_awx
This commit is contained in:
Chris Meyers
2026-02-03 08:25:10 -05:00
committed by Chris Meyers
parent 5aa3e8cf3b
commit e3ac581fdf

View File

@@ -257,8 +257,7 @@ class LogstashFormatter(LogstashFormatterBase):
return fields
def format(self, record):
stamp = datetime.utcfromtimestamp(record.created)
stamp = stamp.replace(tzinfo=tzutc())
stamp = datetime.fromtimestamp(record.created, tz=tzutc())
message = {
# Field not included, but exist in related logs
# 'path': record.pathname