summaryrefslogtreecommitdiffstats
path: root/zte/vmanager/driver/settings.py
diff options
context:
space:
mode:
Diffstat (limited to 'zte/vmanager/driver/settings.py')
-rw-r--r--zte/vmanager/driver/settings.py12
1 files changed, 9 insertions, 3 deletions
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: