X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=zte%2Fvmanager%2Fdriver%2Fsettings.py;fp=zte%2Fvmanager%2Fdriver%2Fsettings.py;h=a9e0d3d2f7920f36a8915ce3f64ec7832b91647a;hb=5c66635c3519f11c788598ac5b343c4f2c44a6a0;hp=ddc2a86a92cdb9776f5e1a90e51137e19bcad75e;hpb=853f2970c1566825efe2e96caa6c2e7c8e7d23e0;p=vfc%2Fnfvo%2Fdriver%2Fvnfm%2Fsvnfm.git diff --git a/zte/vmanager/driver/settings.py b/zte/vmanager/driver/settings.py index ddc2a86a..a9e0d3d2 100644 --- a/zte/vmanager/driver/settings.py +++ b/zte/vmanager/driver/settings.py @@ -16,10 +16,9 @@ import os import sys import platform from logging import config -from onaplogging import monkey -monkey.patch_all() # Build paths inside the project like this: os.path.join(BASE_DIR, ...) +import yaml BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -60,7 +59,6 @@ MIDDLEWARE_CLASSES = [ 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', - 'driver.middleware.LogContextMiddleware', ] ROOT_URLCONF = 'driver.urls' @@ -148,9 +146,17 @@ if platform.system() == 'Windows' or 'test' in sys.argv: }} else: LOGGING_CONFIG = None + + log_path = '/var/log/onap/vfc/ztevnfmdriver' + if not os.path.exists(log_path): + os.makedirs(log_path) + # yaml configuration of logging LOGGING_FILE = os.path.join(BASE_DIR, 'driver/log.yml') config.yamlConfig(filepath=LOGGING_FILE, watchDog=True) + with open(file=LOGGING_FILE, mode='r', encoding="utf-8")as file: + logging_yaml = yaml.load(stream=file, Loader=yaml.FullLoader) + config.dictConfig(config=logging_yaml) if 'test' in sys.argv: