From 1cbbd722094a214034690599440b3cd62e002e64 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 3 Oct 2017 14:53:59 +0000 Subject: Add: log to syslog until slog is configured --- ick_controller.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ick_controller.py') diff --git a/ick_controller.py b/ick_controller.py index a029145..6868f86 100644 --- a/ick_controller.py +++ b/ick_controller.py @@ -15,6 +15,7 @@ # along with this program. If not, see . +import logging import os @@ -53,9 +54,16 @@ def load_config(filename, defconf): return actual_config +logger = logging.getLogger() +logger.setLevel(logging.DEBUG) +handler = logging.handler.SysLogHandler(address='/dev/log') +logger.addHandler(handler) + config_filename = os.environ.get('ICK_CONTROLLER_CONFIG') if not config_filename: + logging.error('no ICK_CONTROLLER_CONFIG in environment') raise Exception('No ICK_CONTROLLER_CONFIG defined in environment') + config = load_config(config_filename, default_config) ick2.setup_logging(config) ick2.log.log('info', msg_text='Ick2 controller starts', config=config) -- cgit v1.2.1