From efbe97be1a573cb4a3d8f20bf2c72c1940f2e383 Mon Sep 17 00:00:00 2001 From: David Erb Date: Wed, 8 Feb 2023 07:07:19 +0000 Subject: [PATCH] add debug about graylog enabled --- src/dls_mainiac_lib/mainiac.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dls_mainiac_lib/mainiac.py b/src/dls_mainiac_lib/mainiac.py index 3397848..5542185 100644 --- a/src/dls_mainiac_lib/mainiac.py +++ b/src/dls_mainiac_lib/mainiac.py @@ -431,7 +431,8 @@ def configure_logging(self, settings=None): import graypy # Create and enable graylog handler - if graypy_settings.get("protocol", "UDP") == "UDP": + protocol = graypy_settings.get("protocol", "UDP") + if protocol == "UDP": graypy_handler_class = graypy.GELFUDPHandler else: graypy_handler_class = graypy.GELFTCPHandler @@ -446,6 +447,10 @@ def configure_logging(self, settings=None): graypy_handler.setLevel(logging.DEBUG) logging.getLogger().addHandler(graypy_handler) + logger.debug( + f"graypy logging handler enabled to {host}:{port} {protocol}" + ) + else: graypy_handler = None