There are questions related on using milliseconds in python logging, there are questions related on how to use UTC, but I cannot see how to combine these two. Based on this question, how can I use the UTC time for logging instead the local time?
def formatTime(self, record, datefmt=None):
ct = self.converter(record.created)
if datefmt:
s = time.strftime(datefmt, ct)
else:
t = time.strftime("%Y-%m-%d %H:%M:%S", ct)
s = "%s,%03d" % (t, record.msecs)
return s