From 05c2ecdb898adb4e6a6ac4033152a0a44fed0d2e Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Wed, 7 Jan 2015 11:46:06 -0500 Subject: [PATCH] Changed logger init to use paths relative to current file --- python_apps/media-monitor/media-monitor/mm1.py | 2 +- python_apps/pypo/pypo/pypomessagehandler.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/python_apps/media-monitor/media-monitor/mm1.py b/python_apps/media-monitor/media-monitor/mm1.py index de286994a..615b1c7d1 100755 --- a/python_apps/media-monitor/media-monitor/mm1.py +++ b/python_apps/media-monitor/media-monitor/mm1.py @@ -61,7 +61,7 @@ def configure_locale(): # configure logging try: - logging.config.fileConfig("logging.cfg") + logging.config.fileConfig("%s/logging.cfg" % os.path.dirname(os.path.realpath(__file__))) #need to wait for Python 2.7 for this.. #logging.captureWarnings(True) diff --git a/python_apps/pypo/pypo/pypomessagehandler.py b/python_apps/pypo/pypo/pypomessagehandler.py index c9f9110f5..62551b7d3 100755 --- a/python_apps/pypo/pypo/pypomessagehandler.py +++ b/python_apps/pypo/pypo/pypomessagehandler.py @@ -2,6 +2,7 @@ import logging import traceback +import os import sys from threading import Thread import time @@ -15,7 +16,7 @@ import json from std_err_override import LogWriter # configure logging -logging.config.fileConfig("logging.cfg") +logging.config.fileConfig("%s/logging.cfg" % os.path.dirname(os.path.realpath(__file__))) logger = logging.getLogger('message_h') LogWriter.override_std_err(logger)