From 7cf4bf5c8cec05cb10a8c6a90c4040b1dbb33049 Mon Sep 17 00:00:00 2001 From: Tyson Clugg Date: Tue, 22 Sep 2015 11:46:50 +1000 Subject: [PATCH] Fix bug in serialization of logging.LogRecord to show formatted message. --- dddp/logging.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dddp/logging.py b/dddp/logging.py index c4de8c9..2560558 100644 --- a/dddp/logging.py +++ b/dddp/logging.py @@ -1,6 +1,7 @@ """Django DDP logging helpers.""" from __future__ import absolute_import, print_function +import datetime import logging from dddp import THREAD_LOCAL as this, meteor_random_id, ADDED @@ -18,6 +19,7 @@ class DDPHandler(logging.Handler): 'collection': 'logs', 'id': meteor_random_id('/collection/logs'), 'fields': { + 'created': datetime.datetime.fromtimestamp(record.created), 'name': record.name, 'levelno': record.levelno, 'levelname': record.levelname,