From cf719bc5d32a53aea394e8a2473812dff1412340 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 27 Aug 2020 12:04:55 +0200 Subject: [PATCH] Fix logformat to use epoch timestamp in ms --- freqtrade/rpc/rpc.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index b7a4f4f8c..fed170001 100644 --- a/freqtrade/rpc/rpc.py +++ b/freqtrade/rpc/rpc.py @@ -640,10 +640,15 @@ class RPC: else: buffer = bufferHandler.buffer records = [[datetime.fromtimestamp(r.created).strftime("%Y-%m-%d %H:%M:%S"), - r.created, r.name, r.levelname, + r.created * 1000, r.name, r.levelname, r.message + ('\n' + r.exc_text if r.exc_text else '')] for r in buffer] + # Logs format: + # [logtime-formatted, logepoch, logger-name, loglevel, message \n + exception] + # e.g. ["2020-08-27 11:35:01", 1598520901097.9397, + # "freqtrade.worker", "INFO", "Starting worker develop"] + return {'log_count': len(records), 'logs': records} def _rpc_edge(self) -> List[Dict[str, Any]]: