This is an automated email from the ASF dual-hosted git repository.
apurtell pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2 by this push:
new 20895c7ec5 HBASE-26854 Shell startup logs a bunch of noise (#4469)
20895c7ec5 is described below
commit 20895c7ec58ef9d728b2b475a55012bda77771b9
Author: Andrew Purtell <[email protected]>
AuthorDate: Fri May 27 14:00:41 2022 -0700
HBASE-26854 Shell startup logs a bunch of noise (#4469)
Upon startup the shell logs a bunch of noise, mainly from zookeeper.
Also hide WARN level logging from the Hadoop libraries
Signed-off-by: Sean Busbey <[email protected]>
Signed-off-by: Viraj Jasani <[email protected]>
---
hbase-shell/src/main/ruby/jar-bootstrap.rb | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/hbase-shell/src/main/ruby/jar-bootstrap.rb
b/hbase-shell/src/main/ruby/jar-bootstrap.rb
index 917817fc59..3f0e650947 100644
--- a/hbase-shell/src/main/ruby/jar-bootstrap.rb
+++ b/hbase-shell/src/main/ruby/jar-bootstrap.rb
@@ -104,7 +104,7 @@ opts = GetoptLong.new(
opts.ordering = GetoptLong::REQUIRE_ORDER
script2run = nil
-log_level = org.apache.log4j.Level::ERROR
+log_level = org.apache.logging.log4j.Level::ERROR
@shell_debug = false
interactive = true
full_backtrace = false
@@ -118,7 +118,7 @@ opts.each do |opt, arg|
when D_ARG
conf_from_cli = add_to_configuration(conf_from_cli, arg)
when '--debug'
- log_level = org.apache.log4j.Level::DEBUG
+ log_level = org.apache.logging.log4j.Level::DEBUG
full_backtrace = true
@shell_debug = true
puts 'Setting DEBUG log level...'
@@ -138,8 +138,8 @@ script2run = ARGV.shift unless ARGV.empty?
ARGV.unshift('-d') if @shell_debug
# Set logging level to avoid verboseness
-org.apache.log4j.Logger.getLogger('org.apache.zookeeper').setLevel(log_level)
-org.apache.log4j.Logger.getLogger('org.apache.hadoop.hbase').setLevel(log_level)
+org.apache.logging.log4j.core.config.Configurator.setAllLevels('org.apache.zookeeper',
log_level)
+org.apache.logging.log4j.core.config.Configurator.setAllLevels('org.apache.hadoop',
log_level)
# Require HBase now after setting log levels
require 'hbase_constants'
@@ -165,14 +165,14 @@ def debug
if @shell_debug
@shell_debug = false
conf.back_trace_limit = 0
- log_level = org.apache.log4j.Level::ERROR
+ log_level = org.apache.logging.log4j.Level::ERROR
else
@shell_debug = true
conf.back_trace_limit = 100
- log_level = org.apache.log4j.Level::DEBUG
+ log_level = org.apache.logging.log4j.Level::DEBUG
end
- org.apache.log4j.Logger.getLogger('org.apache.zookeeper').setLevel(log_level)
-
org.apache.log4j.Logger.getLogger('org.apache.hadoop.hbase').setLevel(log_level)
+
org.apache.logging.log4j.core.config.Configurator.setAllLevels('org.apache.zookeeper',
log_level)
+
org.apache.logging.log4j.core.config.Configurator.setAllLevels('org.apache.hadoop',
log_level)
debug?
end