Change the log filepath 51/34651/2
authorYun Huang <yun.huang@windriver.com>
Thu, 8 Mar 2018 06:39:55 +0000 (14:39 +0800)
committerYun Huang <yun.huang@windriver.com>
Thu, 8 Mar 2018 06:39:55 +0000 (14:39 +0800)
As required by logging project

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

index 6efd9b3..05413d2 100644 (file)
@@ -17,10 +17,14 @@ 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:9005 2>&1 &
 
-while [ ! -f logs/runtime_titanium_cloud.log ]; do
+logDir="/var/log/onap/multicloud/openstack/windriver"
+if [ ! -x  $logDir  ]; then
+       mkdir -p $logDir
+fi
+while [ ! -f $logDir/titanium_cloud.log ]; do
     sleep 1
 done
 
-tail -F logs/runtime_titanium_cloud.log
+tail -F $logDir/titanium_cloud.log
 
 
index c8e3951..3190068 100644 (file)
@@ -91,7 +91,7 @@ LOGGING = {
         'titanium_cloud_handler': {
             'level': 'DEBUG',
             'class': 'logging.handlers.RotatingFileHandler',
-            'filename': os.path.join(BASE_DIR, 'logs/runtime_titanium_cloud.log'),
+            'filename': '/var/log/onap/multicloud/openstack/windriver/titanium_cloud.log',
             'formatter': 'standard',
             'maxBytes': 1024 * 1024 * 50,
             'backupCount': 5,
@@ -104,7 +104,12 @@ LOGGING = {
             'level': 'DEBUG',
             'propagate': False
         },
-        'newton': {
+        'newton_base': {
+            'handlers': ['titanium_cloud_handler'],
+            'level': 'DEBUG',
+            'propagate': False
+        },
+        'common': {
             'handlers': ['titanium_cloud_handler'],
             'level': 'DEBUG',
             'propagate': False
@@ -147,6 +152,8 @@ MULTIVIM_VERSION = "multicloud-" + OPENSTACK_VERSION
 
 if 'test' in sys.argv:
 
+    LOGGING['handlers']['titanium_cloud_handler']['filename'] = 'logs/titanium_cloud.log'
+
     REST_FRAMEWORK = {}
     import platform