summaryrefslogtreecommitdiffstats
path: root/mgr
diff options
context:
space:
mode:
Diffstat (limited to 'mgr')
-rw-r--r--mgr/mgr/settings.py75
1 files changed, 36 insertions, 39 deletions
diff --git a/mgr/mgr/settings.py b/mgr/mgr/settings.py
index 5328a51..961c4fb 100644
--- a/mgr/mgr/settings.py
+++ b/mgr/mgr/settings.py
@@ -14,6 +14,7 @@
import os
import sys
+import platform
import redisco
@@ -123,48 +124,44 @@ TIME_ZONE = 'UTC'
# https://docs.djangoproject.com/en/1.6/howto/static-files/
STATIC_URL = '/static/'
-#
-# LOGGING = {
-# 'version': 1,
-# 'disable_existing_loggers': True,
-# 'formatters': {
-# 'standard': {
-# 'format': '%(asctime)s:[%(name)s]:[%(filename)s]-[%(lineno)d] [%(levelname)s]:%(message)s',
-# },
-# },
-# 'filters': {
-# },
-# 'handlers': {
-# 'mgr_handler': {
-# 'level': 'DEBUG',
-# 'class': 'logging.handlers.RotatingFileHandler',
-# 'filename': os.path.join(BASE_DIR, 'logs/runtime_mgr.log'),
-# 'formatter': 'standard',
-# 'maxBytes': 1024 * 1024 * 50,
-# 'backupCount': 5,
-# },
-# },
-#
-# 'loggers': {
-# 'mgr': {
-# 'handlers': ['mgr_handler'],
-# 'level': 'DEBUG',
-# 'propagate': False
-# },
-# }
-# }
-
-LOGGING_CONFIG = None
-# yaml configuration of logging
-LOGGING_FILE = os.path.join(BASE_DIR, 'mgr/log.yml')
-if 'test' in sys.argv:
- os.system('sed -i "s|/var/log/onap/vfc/gvnfm-vnfmgr|/tmp|" %s' % LOGGING_FILE)
-config.yamlConfig(filepath=LOGGING_FILE, watchDog=True)
+if platform.system() == 'Windows' or 'test' in sys.argv:
+ LOGGING = {
+ 'version': 1,
+ 'disable_existing_loggers': True,
+ 'formatters': {
+ 'standard': {
+ 'format': '%(asctime)s:[%(name)s]:[%(filename)s]-[%(lineno)d] [%(levelname)s]:%(message)s',
+ },
+ },
+ 'filters': {
+ },
+ 'handlers': {
+ 'mgr_handler': {
+ 'level': 'DEBUG',
+ 'class': 'logging.handlers.RotatingFileHandler',
+ 'filename': os.path.join(BASE_DIR, 'logs/runtime_mgr.log'),
+ 'formatter': 'standard',
+ 'maxBytes': 1024 * 1024 * 50,
+ 'backupCount': 5,
+ },
+ },
+
+ 'loggers': {
+ 'mgr': {
+ 'handlers': ['mgr_handler'],
+ 'level': 'DEBUG',
+ 'propagate': False
+ },
+ }
+ }
+else:
+ LOGGING_CONFIG = None
+ LOGGING_FILE = os.path.join(BASE_DIR, 'mgr/log.yml')
+ config.yamlConfig(filepath=LOGGING_FILE, watchDog=True)
-if 'test' in sys.argv:
- os.system('sed -i "s|/tmp|/var/log/onap/vfc/gvnfm-vnfmgr|" %s' % LOGGING_FILE)
+if 'test' in sys.argv:
from mgr.pub.config import config
config.REG_TO_MSB_WHEN_START = False
DATABASES = {}