Sha256: cfd0638cb189e489784d39e95fad3d8533c548b39fa0f440a47e10037f57d3a6

Contents?: true

Size: 572 Bytes

Versions: 12

Compression:

Stored size: 572 Bytes

Contents

#!/usr/bin/env jruby
require 'rubygems'
require 'jmx4r'

logging = JMX::MBean.find_by_name "java.util.logging:type=Logging"
puts "--"
logging.logger_names.sort.each do |logger|
  level = logging.get_logger_level logger
  puts "#{logger} #{level}"
end
puts "--"

if ARGV.length == 1
  level = ARGV[0]
  puts "set all loggers to #{level}"
  logging.logger_names.each do |logger|
    logging.set_logger_level logger, level
  end    
end

if ARGV.length == 2
  logger = ARGV[0]
  level = ARGV[1]
  puts "set #{logger} to #{level}"
  logging.set_logger_level logger, level
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
weblogic-jmx4r-0.1.9 examples/logging.rb
jmx4r-0.1.4 examples/logging.rb
jmx4r-0.1.3 examples/logging.rb
jmx4r-0.1.2 examples/logging.rb
jmx4r-0.1.1 examples/logging.rb
jmx4r-0.1.0 examples/logging.rb
jmx4r-0.0.4 examples/logging.rb
jmx4r-0.0.3 examples/logging.rb
jmx4r-0.0.5 examples/logging.rb
jmx4r-0.0.7 examples/logging.rb
jmx4r-0.0.6 examples/logging.rb
jmx4r-0.0.8 examples/logging.rb