Sha256: e7646690a6e4750cb5507baa1896b12397027734d4206e503f12ac813bab3993

Contents?: true

Size: 569 Bytes

Versions: 2

Compression:

Stored size: 569 Bytes

Contents

#!/usr/bin/env jruby

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

2 entries across 2 versions & 1 rubygems

Version Path
jmx4r-0.0.1 examples/logging.rb
jmx4r-0.0.2 examples/logging.rb