class Log4r::OmlOutputter

Log4r outputter which turn logging events into an OML stream

Public Class Methods

new(name, opts = {}) click to toggle source

Initialise an outputter which turns logging messages into an OML stream

param name Name of outputter param opts Options for setting up OML opts collect If set to an URL, then initialise OML otherwise assume that someone else is doing it opts domain OML domain to send to (assumes that 'collect' is set) ['log'] opts appName OML domain to send to (assumes that 'collect' is set) [fileName-time-pid]

Calls superclass method
# File lib/oml4r/log4r/oml_outputter.rb, line 42
def initialize(name, opts = {})
  super(name, opts)
  if url = opts['collect']
    h = {}
    opts.each {|k, v| h[k.to_sym] = v}
    opts = h

    opts[:domain] ||= 'log'
    opts[:appName] ||= File.basename(__FILE__, '.*')
    opts[:id] ||= "#{Socket.gethostname}-#{Time.now.iso8601}-#{Process.pid}"
    OML4R.init(nil, opts)
  end
end

Public Instance Methods

close() click to toggle source
# File lib/oml4r/log4r/oml_outputter.rb, line 60
def close
  # OutputterFactory.create_methods(self)
  # Logger.log_internal {"Outputter '#{@name}' closed Syslog and set to OFF"}
end
closed?() click to toggle source
# File lib/oml4r/log4r/oml_outputter.rb, line 56
def closed?
  false
end

Private Instance Methods

canonical_log(le) click to toggle source
# File lib/oml4r/log4r/oml_outputter.rb, line 67
def canonical_log(le)
  LogEventMP.inject le.level, le.fullname, le.tracer || '', le.data || ''
end