diff --git a/Dockerfile b/Dockerfile index 72eb464..16ebe31 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,7 @@ RUN apt-get update \ motor \ prometheus_client \ sanic==21.6.2 \ + sanic-json-logging \ git+https://github.com/Assarius/sanic-prometheus@Sanic_22 \ && apt-get remove -y \ build-essential \ diff --git a/camdetect.py b/camdetect.py index 2c304e4..1a51656 100755 --- a/camdetect.py +++ b/camdetect.py @@ -18,6 +18,7 @@ from math import inf from motor.motor_asyncio import AsyncIOMotorClient from prometheus_client import Counter, Gauge, Histogram from sanic import Sanic, response +from sanic_json_logging import setup_json_logging from sanic.log import logger from sanic_prometheus import monitor from sanic.response import stream @@ -409,6 +410,7 @@ async def downloader(queue: asyncio.Queue): await asyncio.sleep(1) app = Sanic("camdetect") +setup_json_logging(app) @app.route("/bypass")