This is an automated email from the ASF dual-hosted git repository.

jiangtian pushed a commit to branch log_tool
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/log_tool by this push:
     new d0bd513  add start-up script of LogVisualizer
d0bd513 is described below

commit d0bd5131ff9c81dd6cd32afa5d2c8de25bd68489
Author: jt <[email protected]>
AuthorDate: Wed Aug 28 11:45:09 2019 +0800

    add start-up script of LogVisualizer
---
 .../resources/tools/logAnalyze/log-visualizer.bat  | 67 ++++++++++++++++++++++
 .../resources/tools/logAnalyze/log-visualizer.sh   | 47 +++++++++++++++
 .../apache/iotdb/db/tools/logvisual/LogFilter.java |  1 +
 3 files changed, 115 insertions(+)

diff --git a/server/src/assembly/resources/tools/logAnalyze/log-visualizer.bat 
b/server/src/assembly/resources/tools/logAnalyze/log-visualizer.bat
new file mode 100644
index 0000000..1f29a1d
--- /dev/null
+++ b/server/src/assembly/resources/tools/logAnalyze/log-visualizer.bat
@@ -0,0 +1,67 @@
+@REM
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements.  See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership.  The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License.  You may obtain a copy of the License at
+@REM
+@REM     http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied.  See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM
+
+
+@echo off
+if "%OS%" == "Windows_NT" setlocal
+
+pushd %~dp0..\..
+if NOT DEFINED IOTDB_HOME set IOTDB_HOME=%CD%
+popd
+
+set IOTDB_CONF=%IOTDB_HOME%\conf
+
+if NOT DEFINED MAIN_CLASS set 
MAIN_CLASS=org.apache.iotdb.db.tools.logvisual.gui.LogVisualizationGui
+if NOT DEFINED JAVA_HOME goto :err
+
+@REM 
-----------------------------------------------------------------------------
+@REM JVM Opts we'll use in legacy run or installation
+set JAVA_OPTS=-ea^
+ -Dlogback.configurationFile="%IOTDB_CONF%\logback-tool.xml"^
+ -DIOTDB_HOME=%IOTDB_HOME%
+
+@REM ***** CLASSPATH library setting *****
+@REM Ensure that any user defined CLASSPATH variables are not used on startup
+set CLASSPATH="%IOTDB_HOME%\lib"
+
+@REM For each jar in the IOTDB_HOME lib directory call append to build the 
CLASSPATH variable.
+for %%i in ("%IOTDB_HOME%\lib\*.jar") do call :append "%%i"
+goto okClasspath
+
+:append
+set CLASSPATH=%CLASSPATH%;%1
+goto :eof
+
+@REM 
-----------------------------------------------------------------------------
+:okClasspath
+
+"%JAVA_HOME%\bin\java" %JAVA_OPTS% %JAVA_OPTS% -cp "%CLASSPATH%" %MAIN_CLASS% 
%*
+
+goto finally
+
+
+:err
+echo JAVA_HOME environment variable must be set!
+pause
+
+
+@REM 
-----------------------------------------------------------------------------
+:finally
+
+ENDLOCAL
\ No newline at end of file
diff --git a/server/src/assembly/resources/tools/logAnalyze/log-visualizer.sh 
b/server/src/assembly/resources/tools/logAnalyze/log-visualizer.sh
new file mode 100644
index 0000000..0eaef37
--- /dev/null
+++ b/server/src/assembly/resources/tools/logAnalyze/log-visualizer.sh
@@ -0,0 +1,47 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+if [ -z "${IOTDB_HOME}" ]; then
+  export IOTDB_HOME="$(cd "`dirname "$0"`"/../..; pwd)"
+fi
+
+IOTDB_CONF=${IOTDB_HOME}/conf
+
+CLASSPATH=""
+for f in ${IOTDB_HOME}/lib/*.jar; do
+  CLASSPATH=${CLASSPATH}":"$f
+done
+
+MAIN_CLASS=org.apache.iotdb.db.tools.logvisual.gui.LogVisualizationGui
+
+if [ -n "$JAVA_HOME" ]; then
+    for java in "$JAVA_HOME"/bin/amd64/java "$JAVA_HOME"/bin/java; do
+        if [ -x "$java" ]; then
+            JAVA="$java"
+            break
+        fi
+    done
+else
+    JAVA=java
+fi
+
+iotdb_parms="-Dlogback.configurationFile=${IOTDB_CONF}/logback-tool.xml"
+
+exec "$JAVA" $iotdb_parms -cp "$CLASSPATH" "$MAIN_CLASS" "$@"
\ No newline at end of file
diff --git 
a/server/src/main/java/org/apache/iotdb/db/tools/logvisual/LogFilter.java 
b/server/src/main/java/org/apache/iotdb/db/tools/logvisual/LogFilter.java
index fdc37e5..4da8d15 100644
--- a/server/src/main/java/org/apache/iotdb/db/tools/logvisual/LogFilter.java
+++ b/server/src/main/java/org/apache/iotdb/db/tools/logvisual/LogFilter.java
@@ -39,6 +39,7 @@ public class LogFilter {
   }
 
   LogFilter(Properties properties) throws IOException {
+    this();
     minLevel = 
LogLevel.valueOf(properties.getProperty(MIN_LEVEL.getPropertyName(), 
minLevel.name()));
 
     String threadNameWhiteListStr = 
properties.getProperty(THREAD_NAME_WHITE_LIST.getPropertyName());

Reply via email to