Method: HBase.log4j=

Defined in:
lib/hbase-jruby/hbase.rb

.HBase.log4j=(filename) ⇒ String .HBase.log4j=(hash) ⇒ Hash .HBase.log4j=(props) ⇒ java.util.Properties

Overloads:

  • .HBase.log4j=(filename) ⇒ String

    Configure Log4j logging with the given file

    Parameters:

    • filename (String)

      Path to log4j.properties or log4j.xml file

    Returns:

    • (String)
  • .HBase.log4j=(hash) ⇒ Hash

    Configure Log4j logging with the given Hash

    Parameters:

    • hash (Hash)

      Log4j properties in Ruby Hash

    Returns:

    • (Hash)
  • .HBase.log4j=(props) ⇒ java.util.Properties

    Configure Log4j logging with the given Properties

    Parameters:

    • props (java.util.Properties)

      Properties object

    Returns:

    • (java.util.Properties)


30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/hbase-jruby/hbase.rb', line 30

def self.log4j= arg
  if arg.is_a?(Hash)
    props = java.util.Properties.new
    arg.each do |k, v|
      props.setProperty k.to_s, v.to_s
    end
    org.apache.log4j.PropertyConfigurator.configure props
  else
    case File.extname(arg).downcase
    when '.xml'
      org.apache.log4j.xml.DOMConfigurator.configure arg
    else
      org.apache.log4j.PropertyConfigurator.configure arg
    end
  end
end