diff --git a/config.ini.default b/config.ini.default index 02e65e3..70184e5 100644 --- a/config.ini.default +++ b/config.ini.default @@ -8,3 +8,7 @@ local= [DELUGE] script= + +[ELASTIC] +host= +port= diff --git a/logger.py b/logger.py index 47d7590..d14e43e 100644 --- a/logger.py +++ b/logger.py @@ -5,6 +5,8 @@ import os import json import urllib.request +from utils import getConfig + BASE_DIR = os.path.dirname(os.path.abspath(__file__)) LOG_FILE = os.path.join(BASE_DIR, 'output.log') @@ -45,7 +47,10 @@ class ESHandler(logging.Handler): response = response.read().decode('utf8') return response -eh = ESHandler(host='localhost') +config = getConfig() +esHost = config['ELASTIC']['host'] +esPort = config['ELASTIC']['port'] +eh = ESHandler(host=esHost, port=esPort) eh.setLevel(logging.DEBUG) formatter = logging.Formatter('%(asctime)s %(levelname)8s | %(message)s')