From 1bf84e64ce12d1e34fe5d72d6fc0411aed20cf26 Mon Sep 17 00:00:00 2001 From: Huang Haibin Date: Thu, 15 Mar 2018 22:02:16 +0800 Subject: modify log directory Change-Id: I119b9018b9f403fb9f6637abe048e99f0f00c0c1 Issue-ID: MULTICLOUD-138 Signed-off-by: Huang Haibin --- newton/newton/settings.py | 3 +- newton/pom.xml | 70 +++++++++++++++++++++++------------------------ newton/run.sh | 8 ++++-- 3 files changed, 43 insertions(+), 38 deletions(-) diff --git a/newton/newton/settings.py b/newton/newton/settings.py index 4b08d2a6..aafcfbbc 100644 --- a/newton/newton/settings.py +++ b/newton/newton/settings.py @@ -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 diff --git a/newton/pom.xml b/newton/pom.xml index 091b6519..c0401c1a 100644 --- a/newton/pom.xml +++ b/newton/pom.xml @@ -61,42 +61,42 @@ - - - - - org.codehaus.mojo + + + + + org.codehaus.mojo exec-maven-plugin - 1.2.1 - - - clean phase script - clean - - exec - - - - __ - clean - - - - - test script - test - - exec - - - - __ - test - - - - - + 1.2.1 + + + clean phase script + clean + + exec + + + + __ + clean + + + + + test script + test + + exec + + + + __ + test + + + + + maven-assembly-plugin diff --git a/newton/run.sh b/newton/run.sh index 0e2bee32..43de581f 100755 --- a/newton/run.sh +++ b/newton/run.sh @@ -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 -- cgit 1.2.3-korg