X-Git-Url: https://gerrit.onap.org/r/gitweb?p=multicloud%2Fframework.git;a=blobdiff_plain;f=multivimbroker%2Fmultivimbroker%2Fsettings.py;h=dca2dd62643232ef7856eb4216f234aad1fa9f65;hp=3741d2df34797a79482e6991ddce8e2f76a4f8d9;hb=d346df79314344c238866e9df0fb4b44c92d03ba;hpb=b1b0386b5ed988fbbf25e326c3d0ce951eff07cd diff --git a/multivimbroker/multivimbroker/settings.py b/multivimbroker/multivimbroker/settings.py index 3741d2d..dca2dd6 100644 --- a/multivimbroker/multivimbroker/settings.py +++ b/multivimbroker/multivimbroker/settings.py @@ -1,4 +1,5 @@ # Copyright (c) 2017 Wind River Systems, Inc. +# Copyright (c) 2017-2018 VMware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,11 +12,9 @@ import os import sys - -import redisco - -from multivimbroker.pub.config.config import REDIS_HOST, REDIS_PORT, REDIS_PASSWD -from multivimbroker.pub.config.config import DB_NAME, DB_IP, DB_USER, DB_PASSWD, DB_PORT +from logging import config +from onaplogging import monkey +monkey.patch_all() # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -73,17 +72,13 @@ REST_FRAMEWORK = { DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.mysql', - 'NAME': DB_NAME, - 'HOST': DB_IP, - 'PORT': DB_PORT, - 'USER': DB_USER, - 'PASSWORD': DB_PASSWD, - }, + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } } -redisco.connection_setup(host=REDIS_HOST, port=REDIS_PORT, password=REDIS_PASSWD, db=0) -# CACHE_BACKEND = 'redis_cache.cache://%s@%s:%s' % (REDIS_PASSWD, REDIS_HOST, REDIS_PORT) +# CACHE_BACKEND = 'redis_cache.cache://%s@%s:%s' % +# (REDIS_PASSWD, REDIS_HOST, REDIS_PORT) TIME_ZONE = 'UTC' @@ -92,35 +87,12 @@ TIME_ZONE = 'UTC' 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': { - 'multivimbroker_handler': { - 'level': 'DEBUG', - 'class': 'logging.handlers.RotatingFileHandler', - 'filename': os.path.join(BASE_DIR, 'logs/runtime_multivimbroker.log'), - 'formatter': 'standard', - 'maxBytes': 1024 * 1024 * 50, - 'backupCount': 5, - }, - }, - - 'loggers': { - 'multivimbroker': { - 'handlers': ['multivimbroker_handler'], - 'level': 'DEBUG', - 'propagate': False - }, - } -} + +LOGGING_CONFIG = None +# yaml configuration of logging +LOGGING_FILE = os.path.join(BASE_DIR, 'multivimbroker/pub/config/log.yml') +config.yamlConfig(filepath=LOGGING_FILE, watchDog=True) + if 'test' in sys.argv: from multivimbroker.pub.config import config