Class: CommonEventFormatter

Inherits:
Logger::Formatter
  • Object
show all
Defined in:
lib/common_event_formatter.rb

Constant Summary collapse

VERSION =
"0.1.4"

Instance Method Summary collapse

Instance Method Details

#call(severity, time, progname, msg) ⇒ Object



7
8
9
# File 'lib/common_event_formatter.rb', line 7

def call(severity, time, progname, msg)
  create_event({:level => severity, :time => time, :host => hostname, :app => pwd, :pname => (progname || $0), :msg => msg2str(msg)})
end

#create_event(hash) ⇒ Object



11
12
13
# File 'lib/common_event_formatter.rb', line 11

def create_event(hash)
  hash.merge(process_hash).to_json + "\r\n"
end