Enabling logback file to be loaded using oom configmap 89/100089/3
authora.sreekumar <ajith.sreekumar@est.tech>
Wed, 8 Jan 2020 13:02:10 +0000 (13:02 +0000)
committerJim Hahn <jrh3@att.com>
Thu, 9 Jan 2020 14:25:20 +0000 (14:25 +0000)
Change-Id: I839b687716a72e2538495b46660fa697cdc2f4f8
Issue-ID: POLICY-2308
Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
packages/policy-api-docker/src/main/docker/policy-api.sh
testsuites/stability/src/main/resources/apisetup/config/api/bin/policy-api.sh

index e2242dd..dbd8cc0 100644 (file)
@@ -2,7 +2,7 @@
 #
 # ============LICENSE_START=======================================================
 #  Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
-#  Modifications Copyright (C) 2019 Nordix Foundation.
+#  Modifications Copyright (C) 2019-2020 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -50,4 +50,9 @@ if [[ -f "${POLICY_HOME}"/etc/mounted/policy-keystore ]]; then
     cp -f "${POLICY_HOME}"/etc/mounted/policy-keystore  "${KEYSTORE}"
 fi
 
-$JAVA_HOME/bin/java -cp "${POLICY_HOME}/etc:${POLICY_HOME}/lib/*" -Djavax.net.ssl.keyStore="$KEYSTORE" -Djavax.net.ssl.keyStorePassword="$KEYSTORE_PASSWD" -Djavax.net.ssl.trustStore="$TRUSTSTORE" -Djavax.net.ssl.trustStorePassword="$TRUSTSTORE_PASSWD" org.onap.policy.api.main.startstop.Main -c $CONFIG_FILE
+if [[ -f "${POLICY_HOME}"/etc/mounted/logback.xml ]]; then
+    echo "overriding logback.xml"
+    cp -f "${POLICY_HOME}"/etc/mounted/logback.xml "${POLICY_HOME}"/etc/
+fi
+
+$JAVA_HOME/bin/java -cp "${POLICY_HOME}/etc:${POLICY_HOME}/lib/*" -Dlogback.configurationFile=$POLICY_HOME/etc/logback.xml -Djavax.net.ssl.keyStore="$KEYSTORE" -Djavax.net.ssl.keyStorePassword="$KEYSTORE_PASSWD" -Djavax.net.ssl.trustStore="$TRUSTSTORE" -Djavax.net.ssl.trustStorePassword="$TRUSTSTORE_PASSWD" org.onap.policy.api.main.startstop.Main -c $CONFIG_FILE
index 35463b4..9a3c34e 100644 (file)
@@ -2,6 +2,7 @@
 #
 # ============LICENSE_START=======================================================
 #  Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+#  Modifications Copyright (C) 2020 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -39,4 +40,4 @@ fi
 
 echo "Policy api config file: $CONFIG_FILE"
 
-$JAVA_HOME/bin/java -cp "$POLICY_API_HOME/etc:$POLICY_API_HOME/lib/*" -Djavax.net.ssl.keyStore="$KEYSTORE" -Djavax.net.ssl.keyStorePassword="$KEYSTORE_PASSWD" -Djavax.net.ssl.trustStore="$TRUSTSTORE" -Djavax.net.ssl.trustStorePassword="$TRUSTSTORE_PASSWD" -Dcom.sun.management.jmxremote.rmi.port=9090 -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=false -Djava.rmi.server.hostname=$API_HOST org.onap.policy.api.main.startstop.Main -c $CONFIG_FILE
\ No newline at end of file
+$JAVA_HOME/bin/java -cp "$POLICY_API_HOME/etc:$POLICY_API_HOME/lib/*" -Dlogback.configurationFile=$POLICY_API_HOME/etc/logback.xml -Djavax.net.ssl.keyStore="$KEYSTORE" -Djavax.net.ssl.keyStorePassword="$KEYSTORE_PASSWD" -Djavax.net.ssl.trustStore="$TRUSTSTORE" -Djavax.net.ssl.trustStorePassword="$TRUSTSTORE_PASSWD" -Dcom.sun.management.jmxremote.rmi.port=9090 -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=false -Djava.rmi.server.hostname=$API_HOST org.onap.policy.api.main.startstop.Main -c $CONFIG_FILE