From c4be16decc2d8c6f6c117581279de5188922cd12 Mon Sep 17 00:00:00 2001 From: tierno Date: Thu, 25 Oct 2018 14:27:36 +0200 Subject: [PATCH] cherry-pick change default logging to stdout and info level Change-Id: I0ca1f1d200b863eea042f0e75a87b10a2c9136a7 Signed-off-by: tierno --- docker/Dockerfile-local | 5 ++++- docker/scripts/start.sh | 8 +++++++- openmanod | 5 +++-- osm_ro/openmanod.cfg | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile-local b/docker/Dockerfile-local index 7f1bf01c..30ead5a8 100644 --- a/docker/Dockerfile-local +++ b/docker/Dockerfile-local @@ -55,6 +55,7 @@ EXPOSE 9090 # RO_DB_OVIM_PORT: default value '3306' # RO_DB_NAME: default value 'mano_db' # RO_DB_OVIM_NAME: default value 'mano_vim_db' +# RO_LOG_FILE: default log to stderr if not defined ENV RO_DB_HOST="" \ RO_DB_OVIM_HOST="" \ @@ -67,7 +68,9 @@ ENV RO_DB_HOST="" \ RO_DB_PORT=3306 \ RO_DB_OVIM_PORT=3306 \ RO_DB_NAME=mano_db \ - RO_DB_OVIM_NAME=mano_vim_db + RO_DB_OVIM_NAME=mano_vim_db \ + OPENMANO_TENANT=osm \ + RO_LOG_LEVEL=DEBUG CMD /bin/RO/start.sh diff --git a/docker/scripts/start.sh b/docker/scripts/start.sh index 1506e3a3..f237235b 100755 --- a/docker/scripts/start.sh +++ b/docker/scripts/start.sh @@ -125,4 +125,10 @@ fi echo "4/4 Try to start" -/usr/bin/openmanod -c /etc/osm/openmanod.cfg --log-file=/var/log/osm/openmano.log --create-tenant=osm +# look for openmanod.cfg +RO_CONFIG_FILE="/etc/osm/openmanod.cfg" +[ -f "$RO_CONFIG_FILE" ] || RO_CONFIG_FILE=$(python -c 'import osm_ro; print(osm_ro.__path__[0])')/openmanod.cfg +[ -f "$RO_CONFIG_FILE" ] || ! echo "configuration file 'openmanod.cfg' not found" || exit 1 + +openmanod -c "$RO_CONFIG_FILE" --create-tenant=osm # --log-file=/var/log/osm/openmano.log + diff --git a/openmanod b/openmanod index 6f4c1a8d..d3e55226 100755 --- a/openmanod +++ b/openmanod @@ -49,7 +49,7 @@ import osm_ro __author__ = "Alfonso Tierno, Gerardo Garcia, Pablo Montes" __date__ = "$26-aug-2014 11:09:29$" __version__ = "0.5.75-r585" -version_date = "Ago 2018" +version_date = "Oct 2018" database_version = 32 # expected database schema version @@ -165,7 +165,8 @@ if __name__=="__main__": 'db_ovim_user': 'RO_DB_OVIM_USER', 'db_ovim_passwd': 'RO_DB_OVIM_PASSWORD', 'db_port': 'RO_DB_PORT', - 'db_port': 'RO_DB_PORT', + 'log_level': 'RO_LOG_LEVEL', + 'log_file': 'RO_LOG_FILE', } # Configure logging step 1 hostname = socket.gethostname() diff --git a/osm_ro/openmanod.cfg b/osm_ro/openmanod.cfg index 2aa319ec..2e55cba2 100644 --- a/osm_ro/openmanod.cfg +++ b/osm_ro/openmanod.cfg @@ -62,7 +62,7 @@ auto_push_VNF_to_VIMs: False # by default True #general logging parameters #choose among: DEBUG, INFO, WARNING, ERROR, CRITICAL -log_level: DEBUG #general log levels for internal logging +log_level: INFO #general log levels for internal logging #standard output is used unless 'log_file' is specify #log_file: /var/log/openmano/openmano.log -- 2.25.1