mirror of
https://github.com/laurivosandi/certidude
synced 2024-12-22 08:15:18 +00:00
Use UTC for log entries
This commit is contained in:
parent
c33da46f19
commit
15858083b3
@ -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(),
|
||||
|
@ -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()))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user