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

aengineer pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new c4411f7  HDDS-2042. Avoid log on console with Ozone shell
c4411f7 is described below

commit c4411f7fdf745eefac32749dad4388635a0a9aae
Author: Doroszlai, Attila <adorosz...@apache.org>
AuthorDate: Tue Aug 27 15:55:47 2019 +0200

    HDDS-2042. Avoid log on console with Ozone shell
    
    Signed-off-by: Anu Engineer <aengin...@apache.org>
---
 hadoop-ozone/common/src/main/bin/ozone             |  3 ++
 .../dist/dev-support/bin/dist-layout-stitching     |  1 +
 .../src/main/conf/ozone-shell-log4j.properties     | 33 ++++++++++++++++++++++
 .../src/main/smoketest/basic/ozone-shell.robot     |  1 -
 .../dist/src/main/smoketest/createbucketenv.robot  |  1 -
 .../dist/src/main/smoketest/createmrenv.robot      |  1 -
 6 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/hadoop-ozone/common/src/main/bin/ozone 
b/hadoop-ozone/common/src/main/bin/ozone
index e8cda82..47258d2 100755
--- a/hadoop-ozone/common/src/main/bin/ozone
+++ b/hadoop-ozone/common/src/main/bin/ozone
@@ -118,6 +118,8 @@ function ozonecmd_case
     ;;
     freon)
       HADOOP_CLASSNAME=org.apache.hadoop.ozone.freon.Freon
+      OZONE_FREON_OPTS="${OZONE_FREON_OPTS} -Dhadoop.log.file=ozone-freon.log 
-Dlog4j.configuration=file:${HADOOP_CONF_DIR}/ozone-shell-log4j.properties"
+      HADOOP_OPTS="${HADOOP_OPTS} ${OZONE_FREON_OPTS}"
       OZONE_RUN_ARTIFACT_NAME="hadoop-ozone-tools"
     ;;
     genesis)
@@ -137,6 +139,7 @@ function ozonecmd_case
     ;;
     sh | shell)
       HADOOP_CLASSNAME=org.apache.hadoop.ozone.web.ozShell.OzoneShell
+      HDFS_OM_SH_OPTS="${HDFS_OM_SH_OPTS} -Dhadoop.log.file=ozone-shell.log 
-Dlog4j.configuration=file:${HADOOP_CONF_DIR}/ozone-shell-log4j.properties"
       HADOOP_OPTS="${HADOOP_OPTS} ${HDFS_OM_SH_OPTS}"
       OZONE_RUN_ARTIFACT_NAME="hadoop-ozone-ozone-manager"
     ;;
diff --git a/hadoop-ozone/dist/dev-support/bin/dist-layout-stitching 
b/hadoop-ozone/dist/dev-support/bin/dist-layout-stitching
index 97acc54..00b1b9a 100755
--- a/hadoop-ozone/dist/dev-support/bin/dist-layout-stitching
+++ b/hadoop-ozone/dist/dev-support/bin/dist-layout-stitching
@@ -90,6 +90,7 @@ run cp -r "${ROOT}/hadoop-hdds/common/src/main/conf/" 
"etc/hadoop"
 run cp "${ROOT}/hadoop-ozone/dist/src/main/conf/om-audit-log4j2.properties" 
"etc/hadoop"
 run cp "${ROOT}/hadoop-ozone/dist/src/main/conf/dn-audit-log4j2.properties" 
"etc/hadoop"
 run cp "${ROOT}/hadoop-ozone/dist/src/main/conf/scm-audit-log4j2.properties" 
"etc/hadoop"
+run cp "${ROOT}/hadoop-ozone/dist/src/main/conf/ozone-shell-log4j.properties" 
"etc/hadoop"
 run cp "${ROOT}/hadoop-ozone/dist/src/main/conf/ozone-site.xml" "etc/hadoop"
 run cp -f "${ROOT}/hadoop-ozone/dist/src/main/conf/log4j.properties" 
"etc/hadoop"
 run cp 
"${ROOT}/hadoop-hdds/common/src/main/resources/network-topology-default.xml" 
"etc/hadoop"
diff --git a/hadoop-ozone/dist/src/main/conf/ozone-shell-log4j.properties 
b/hadoop-ozone/dist/src/main/conf/ozone-shell-log4j.properties
new file mode 100644
index 0000000..e8f5f2d
--- /dev/null
+++ b/hadoop-ozone/dist/src/main/conf/ozone-shell-log4j.properties
@@ -0,0 +1,33 @@
+# 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.
+
+# Define some default values that can be overridden by system properties
+hadoop.log.dir=.
+hadoop.log.file=ozone-shell.log
+
+log4j.rootLogger=INFO,FILE
+
+log4j.threshold=ALL
+
+log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.FILE.file=${hadoop.log.dir}/${hadoop.log.file}
+log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.FILE.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c{1}:%L - 
%m%n
+
+log4j.logger.org.apache.hadoop.util.NativeCodeLoader=ERROR
+log4j.logger.org.apache.ratis.conf.ConfUtils=WARN
+log4j.logger.org.apache.hadoop.security.ShellBasedUnixGroupsMapping=ERROR
+log4j.logger.org.apache.ratis.grpc.client.GrpcClientProtocolClient=WARN
diff --git a/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell.robot 
b/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell.robot
index 044ae71..689e4af 100644
--- a/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell.robot
@@ -54,7 +54,6 @@ Test ozone shell
     [arguments]     ${protocol}         ${server}       ${volume}
     ${result} =     Execute             ozone sh volume create 
${protocol}${server}/${volume} --quota 100TB
                     Should not contain  ${result}       Failed
-                    Should contain      ${result}       Creating Volume: 
${volume}
     ${result} =     Execute             ozone sh volume list 
${protocol}${server}/ | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r 
'. | select(.name=="${volume}")'
                     Should contain      ${result}       creationTime
     ${result} =     Execute             ozone sh volume list | grep -Ev 
'Removed|DEBUG|ERROR|INFO|TRACE|WARN' | jq -r '. | select(.name=="${volume}")'
diff --git a/hadoop-ozone/dist/src/main/smoketest/createbucketenv.robot 
b/hadoop-ozone/dist/src/main/smoketest/createbucketenv.robot
index f88a1ee..da97001 100644
--- a/hadoop-ozone/dist/src/main/smoketest/createbucketenv.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/createbucketenv.robot
@@ -29,7 +29,6 @@ ${bucket}       bucket1
 Create volume
     ${result} =     Execute             ozone sh volume create /${volume} 
--user hadoop --quota 100TB
                     Should not contain  ${result}       Failed
-                    Should contain      ${result}       Creating Volume: 
${volume}
 Create bucket
                     Execute             ozone sh bucket create 
/${volume}/${bucket}
 
diff --git a/hadoop-ozone/dist/src/main/smoketest/createmrenv.robot 
b/hadoop-ozone/dist/src/main/smoketest/createmrenv.robot
index a2e3242..2f93e6c 100644
--- a/hadoop-ozone/dist/src/main/smoketest/createmrenv.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/createmrenv.robot
@@ -29,7 +29,6 @@ ${bucket}       bucket1
 Create volume
     ${result} =     Execute             ozone sh volume create /${volume} 
--user hadoop --quota 100TB
                     Should not contain  ${result}       Failed
-                    Should contain      ${result}       Creating Volume: 
${volume}
 Create bucket
                     Execute             ozone sh bucket create 
/${volume}/${bucket}
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to