diff --git a/certidude/mysqllog.py b/certidude/mysqllog.py index e8d3083..514e2f9 100644 --- a/certidude/mysqllog.py +++ b/certidude/mysqllog.py @@ -1,6 +1,7 @@ import logging import time +from datetime import datetime from certidude.api.tag import RelationalMixin class LogHandler(logging.Handler, RelationalMixin): @@ -12,7 +13,7 @@ class LogHandler(logging.Handler, RelationalMixin): def emit(self, record): self.sql_execute("log_insert_entry.sql", - time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(record.created)), + datetime.utcfromtimestamp(record.created), record.name, record.levelno, record.levelname.lower(), diff --git a/certidude/push.py b/certidude/push.py index ae689a9..f84edd0 100644 --- a/certidude/push.py +++ b/certidude/push.py @@ -36,7 +36,7 @@ class PushLogHandler(logging.Handler): def emit(self, record): from certidude.push import publish publish("log-entry", dict( - created = datetime.fromtimestamp(record.created), + created = datetime.utcfromtimestamp(record.created), message = record.msg % record.args, severity = record.levelname.lower()))