modify log directory 99/35899/2
authorHuang Haibin <haibin.huang@intel.com>
Thu, 15 Mar 2018 14:02:16 +0000 (22:02 +0800)
committerHuang Haibin <haibin.huang@intel.com>
Thu, 15 Mar 2018 14:16:04 +0000 (22:16 +0800)
Change-Id: I119b9018b9f403fb9f6637abe048e99f0f00c0c1
Issue-ID: MULTICLOUD-138
Signed-off-by: Huang Haibin <haibin.huang@intel.com>
newton/newton/settings.py
newton/pom.xml
newton/run.sh

index 4b08d2a..aafcfbb 100644 (file)
@@ -98,7 +98,7 @@ LOGGING = {
         'newton_handler': {
             'level': 'DEBUG',
             'class': 'logging.handlers.RotatingFileHandler',
-            'filename': os.path.join(BASE_DIR, 'logs/runtime_newton.log'),
+            'filename': '/var/log/onap/multicloud/openstack/newton/newton.log',
             'formatter': 'standard',
             'maxBytes': 1024 * 1024 * 50,
             'backupCount': 5,
@@ -149,6 +149,7 @@ MULTIVIM_VERSION = "multicloud-" + OPENSTACK_VERSION
 
 
 if 'test' in sys.argv:
+    LOGGING['handlers']['newton_handler']['filename'] = 'logs/newton.log'
 
     REST_FRAMEWORK = {}
     import platform
index 091b651..c0401c1 100644 (file)
                 </environmentVariables>
               </configuration>
             </plugin>
-        </plugins>                                                                                                                                                         
-      </pluginManagement>                                                                                                                                                  
-        <plugins>                                                                                                                                                          
-        <plugin>                                                                                                                                                           
-            <groupId>org.codehaus.mojo</groupId>                                                                                                                           
+        </plugins>
+      </pluginManagement>
+        <plugins>
+        <plugin>
+            <groupId>org.codehaus.mojo</groupId>
             <artifactId>exec-maven-plugin</artifactId>
-            <version>1.2.1</version>                                                                                                                                       
-            <executions>                                                                                                                                                   
-              <execution>                                                                                                                                                  
-                <id>clean phase script</id>                                                                                                                                
-                <phase>clean</phase>                                                                                                                                       
-                <goals>                                                                                                                                                    
-                  <goal>exec</goal>                                                                                                                                        
-                </goals>                                                                                                                                                   
-                <configuration>                                                                                                                                            
-                  <arguments>                                                                                                                                              
-                    <argument>__</argument>                                                                                                                                
-                    <argument>clean</argument>                                                                                                                             
-                  </arguments>                                                                                                                                             
-                </configuration>                                                                                                                                           
-              </execution>                                                                                                                                                 
-              <execution>                                                                                                                                                  
-                <id>test script</id>                                                                                                                                       
-                <phase>test</phase>                                                                                                                                        
-                <goals>                                                                                                                                                    
-                  <goal>exec</goal>                                                                                                                                        
-                </goals>                                                                                                                                                   
-                <configuration>                                                                                                                                            
-                  <arguments>                                                                                                                                              
-                    <argument>__</argument>                                                                                                                                
-                    <argument>test</argument>                                                                                                                              
-                  </arguments>                                                                                                                                             
-                </configuration>                                                                                                                                           
-              </execution>                                                                                                                                                 
-            </executions>                                                                                                                                                  
-        </plugin>                 
+            <version>1.2.1</version>
+            <executions>
+              <execution>
+                <id>clean phase script</id>
+                <phase>clean</phase>
+                <goals>
+                  <goal>exec</goal>
+                </goals>
+                <configuration>
+                  <arguments>
+                    <argument>__</argument>
+                    <argument>clean</argument>
+                  </arguments>
+                </configuration>
+              </execution>
+              <execution>
+                <id>test script</id>
+                <phase>test</phase>
+                <goals>
+                  <goal>exec</goal>
+                </goals>
+                <configuration>
+                  <arguments>
+                    <argument>__</argument>
+                    <argument>test</argument>
+                  </arguments>
+                </configuration>
+              </execution>
+            </executions>
+        </plugin>
         <plugin>
             <artifactId>maven-assembly-plugin</artifactId>
             <configuration>
index 0e2bee3..43de581 100755 (executable)
@@ -17,8 +17,12 @@ 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:9003 2>&1 &
 
-while [ ! -f logs/runtime_newton.log ]; do
+logDir="/var/log/onap/multicloud/openstack/newton"
+if [ ! -x  $logDir  ]; then
+       mkdir -p $logDir
+fi
+while [ ! -f $logDir/newton.log ]; do
     sleep 1
 done
 
-tail -F logs/runtime_newton.log
+tail -F $logDir/newton.log