From a97d1a1fb5502277992b2d599ca479dcd0546424 Mon Sep 17 00:00:00 2001 From: Brian Clements Date: Thu, 6 Mar 2014 11:47:24 -0600 Subject: [PATCH] Issue #2756 reworked collaboration dataserver build replaced install ant script with build script that also deploys new build uses feature explorer, but handles its own compile stage updated deployment and start script to match new build added logging level control argument Former-commit-id: cde0d05820a16f33e72d2c37a968202d98957130 [formerly fac33a8915409bdae379d494fc96ffa17fe19453 [formerly 8e1da85b9d3da580c8d5b53783e2b17c6ee8d00e]] Former-commit-id: fac33a8915409bdae379d494fc96ffa17fe19453 Former-commit-id: acbd4910feddd6b2d6f308b9a568dcd1103a767a --- .../feature.xml | 38 ++++ .../META-INF/MANIFEST.MF | 4 +- .../collaboration.dataserver/build.xml | 168 ++++++++++++++++++ .../dataserver-install.xml | 99 ----------- .../scriptBin/start.sh | 22 +-- .../collaboration/dataserver/Config.java | 4 + .../dataserver/DataserverMain.java | 7 + 7 files changed, 226 insertions(+), 116 deletions(-) create mode 100644 javaUtilities/collaboration.dataserver/build.xml delete mode 100644 javaUtilities/collaboration.dataserver/dataserver-install.xml diff --git a/javaUtilities/collaboration.dataserver.feature/feature.xml b/javaUtilities/collaboration.dataserver.feature/feature.xml index 9704aa6448..b45683756b 100644 --- a/javaUtilities/collaboration.dataserver.feature/feature.xml +++ b/javaUtilities/collaboration.dataserver.feature/feature.xml @@ -74,4 +74,42 @@ install-size="0" version="0.0.0"/> + + + + + + + + + + + + diff --git a/javaUtilities/collaboration.dataserver/META-INF/MANIFEST.MF b/javaUtilities/collaboration.dataserver/META-INF/MANIFEST.MF index 23b382c40b..4ea5af2b0a 100644 --- a/javaUtilities/collaboration.dataserver/META-INF/MANIFEST.MF +++ b/javaUtilities/collaboration.dataserver/META-INF/MANIFEST.MF @@ -10,4 +10,6 @@ Require-Bundle: org.eclipse.jetty, com.raytheon.uf.common.http, com.raytheon.uf.common.xmpp, org.apache.http, - org.apache.commons.collections + org.apache.commons.collections, + org.slf4j, + ch.qos.logback diff --git a/javaUtilities/collaboration.dataserver/build.xml b/javaUtilities/collaboration.dataserver/build.xml new file mode 100644 index 0000000000..c1687df2a1 --- /dev/null +++ b/javaUtilities/collaboration.dataserver/build.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @{includes.file} + + + + + + + + + + + + No files found at @{source.base}/@{line}/@{source.suffix} + + + + + + + + + + + diff --git a/javaUtilities/collaboration.dataserver/dataserver-install.xml b/javaUtilities/collaboration.dataserver/dataserver-install.xml deleted file mode 100644 index 6cc29f6441..0000000000 --- a/javaUtilities/collaboration.dataserver/dataserver-install.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/javaUtilities/collaboration.dataserver/scriptBin/start.sh b/javaUtilities/collaboration.dataserver/scriptBin/start.sh index 89dd3908c0..ccf47e9714 100755 --- a/javaUtilities/collaboration.dataserver/scriptBin/start.sh +++ b/javaUtilities/collaboration.dataserver/scriptBin/start.sh @@ -23,29 +23,19 @@ # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Mar 03, 2014 2756 bclement initial creation +# Mar 06, 2014 2756 bclement changed classpath to reflect new lib structure +# added log level change when debugging # # -function pathgen() -{ - echo -n 'lib/plugins/*' - for x in lib/dependencies/* - do - if [[ $x =~ ^.*\.jar$ ]] - then - echo -n ":$x" - elif [[ -d $x ]] - then - echo -n ":${x}/*" - fi - done -} - if [[ $# > 0 && $1 == '-d' ]] then dbArg='-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5118' + logLevel='-Ddataserver.logging.level=DEBUG' else + # defaults dbArg='' + logLevel='' fi (cd $(dirname "$0")/.. @@ -55,7 +45,7 @@ then echo "PID file already exists at $PIDFILE, exiting" exit 1 fi -nohup java $dbArg -server -cp $(pathgen) com.raytheon.collaboration.dataserver.DataserverMain & +nohup java $dbArg $logLevel -server -cp lib/uframe/*:lib/foss/* com.raytheon.collaboration.dataserver.DataserverMain & echo $! > $PIDFILE ) diff --git a/javaUtilities/collaboration.dataserver/src/com/raytheon/collaboration/dataserver/Config.java b/javaUtilities/collaboration.dataserver/src/com/raytheon/collaboration/dataserver/Config.java index fef6afb611..825b639392 100644 --- a/javaUtilities/collaboration.dataserver/src/com/raytheon/collaboration/dataserver/Config.java +++ b/javaUtilities/collaboration.dataserver/src/com/raytheon/collaboration/dataserver/Config.java @@ -37,6 +37,7 @@ import java.util.Properties; * Feb 5, 2014 2756 bclement Initial creation * Feb 28, 2014 2756 bclement added auth cache size * Mar 04, 2014 2756 bclement added xmpp server retry + * Mar 06, 2014 2756 bclement added logging level * * * @@ -98,6 +99,9 @@ public class Config{ public static final Boolean useStdOut = Boolean .getBoolean("collaboration.dataserver.stdout"); + public static final String loggingLevel = System.getProperty( + "dataserver.logging.level", "INFO"); + private static Properties _props = null; private static Properties _credProps = null; diff --git a/javaUtilities/collaboration.dataserver/src/com/raytheon/collaboration/dataserver/DataserverMain.java b/javaUtilities/collaboration.dataserver/src/com/raytheon/collaboration/dataserver/DataserverMain.java index ac7226a844..9fc3ff9a3f 100644 --- a/javaUtilities/collaboration.dataserver/src/com/raytheon/collaboration/dataserver/DataserverMain.java +++ b/javaUtilities/collaboration.dataserver/src/com/raytheon/collaboration/dataserver/DataserverMain.java @@ -25,6 +25,10 @@ import java.io.PrintStream; import java.util.TimeZone; import org.eclipse.jetty.util.RolloverFileOutputStream; +import org.slf4j.LoggerFactory; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.Logger; import com.raytheon.collaboration.dataserver.auth.ServerAuthManager; @@ -39,6 +43,7 @@ import com.raytheon.collaboration.dataserver.auth.ServerAuthManager; * ------------ ---------- ----------- -------------------------- * Feb 5, 2014 2756 bclement Initial creation * Feb 28, 2014 2756 bclement added authManager + * Mar 06, 2014 2756 bclement added logging level config * * * @@ -108,6 +113,8 @@ public class DataserverMain { * @throws IOException */ private static void configureLogging() throws IOException { + Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); + root.setLevel(Level.valueOf(Config.loggingLevel)); if (Config.useStdOut){ return; }