Change the log filepath of Ocata 79/34879/1
authorYun Huang <yun.huang@windriver.com>
Fri, 9 Mar 2018 02:04:54 +0000 (10:04 +0800)
committerYun Huang <yun.huang@windriver.com>
Fri, 9 Mar 2018 02:04:54 +0000 (10:04 +0800)
As required by logging project

Change-Id: Ie19af29f68d5d482e65c7d0d488d8e4e885c2b5b
Issue-ID: MULTICLOUD-178
Signed-off-by: Yun Huang <yun.huang@windriver.com>
ocata/ocata/settings.py
ocata/run.sh

index efb0296..9f5711d 100644 (file)
@@ -91,7 +91,7 @@ LOGGING = {
         'ocata_handler': {
             'level': 'DEBUG',
             'class': 'logging.handlers.RotatingFileHandler',
-            'filename': os.path.join(BASE_DIR, 'logs/runtime_ocata.log'),
+            'filename': '/var/log/onap/multicloud/openstack/ocata/ocata.log',
             'formatter': 'standard',
             'maxBytes': 1024 * 1024 * 50,
             'backupCount': 5,
@@ -104,7 +104,12 @@ LOGGING = {
             'level': 'DEBUG',
             'propagate': False
         },
-        'newton': {
+        'newton_base': {
+            'handlers': ['ocata_handler'],
+            'level': 'DEBUG',
+            'propagate': False
+        },
+        'common': {
             'handlers': ['ocata_handler'],
             'level': 'DEBUG',
             'propagate': False
@@ -147,6 +152,8 @@ MULTIVIM_VERSION = "multicloud-" + OPENSTACK_VERSION
 
 if 'test' in sys.argv:
 
+    LOGGING['handlers']['ocata_handler']['filename'] = 'logs/ocata.log'
+
     REST_FRAMEWORK = {}
     import platform
 
index a4edae4..f1bcfa9 100644 (file)
@@ -17,9 +17,13 @@ memcached -d -m 2048 -u root -c 1024 -p 11211 -P /tmp/memcached1.pid
 export PYTHONPATH=lib/share
 nohup python manage.py runserver 0.0.0.0:9006 2>&1 &
 
-while [ ! -f logs/runtime_ocata.log ]; do
+logDir="/var/log/onap/multicloud/openstack/ocata"
+if [ ! -x  $logDir  ]; then
+       mkdir -p $logDir
+fi
+while [ ! -f $logDir/ocata.log ]; do
     sleep 1
 done
 
-tail -F logs/runtime_ocata.log
+tail -F $logDir/ocata.log