From f02a415f7d58d2a3c0e74a5b6bda591e3ad81633 Mon Sep 17 00:00:00 2001 From: Jaimyn Mayer Date: Fri, 31 May 2024 11:18:00 +1000 Subject: [PATCH] adjust logging --- memberportal/membermatters/celeryapp.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/memberportal/membermatters/celeryapp.py b/memberportal/membermatters/celeryapp.py index 9d1ba215..827298de 100644 --- a/memberportal/membermatters/celeryapp.py +++ b/memberportal/membermatters/celeryapp.py @@ -1,5 +1,6 @@ import os -from celery import Celery, signals +from celery import Celery +from celery.signals import celeryd_init from prometheus_client import CollectorRegistry, multiprocess, start_http_server import logging @@ -26,14 +27,14 @@ def debug_task(self): print(f"Request: {self.request!r}") -@signals.celeryd_init.connect -def name_this_what_you_want(sender=None, conf=None, **kwargs): - logger.debug( +@celeryd_init.connect +def celery_prom_server(sender=None, conf=None, **kwargs): + logger.info( "Starting CollectorRegistry() and multiprocess.MultiProcessCollector()..." ) registry = CollectorRegistry() multiprocess.MultiProcessCollector(registry) - logger.debug("Starting Prometheus metrics server on port 8000...") + logger.info("Starting Prometheus metrics server on port 8000...") start_http_server(8000, registry=registry) logger.info("Prometheus metrics server started on port 8000!")