lib/logstasher/log_subscriber.rb in logstasher-0.6.2 vs lib/logstasher/log_subscriber.rb in logstasher-0.6.5
- old
+ new
@@ -13,11 +13,11 @@
data.merge! extract_exception(payload)
data.merge! extract_custom_fields(payload)
tags = ['request']
tags.push('exception') if payload[:exception]
- event = LogStash::Event.new('@source' => LogStasher.source, '@fields' => data, '@tags' => tags)
+ event = LogStash::Event.new(data.merge('source' => LogStasher.source, 'tags' => tags))
LogStasher.logger << event.to_json + "\n"
end
def redirect_to(event)
Thread.current[:logstasher_location] = event.payload[:location]
@@ -120,10 +120,10 @@
private
def process_event(event, tags)
data = LogStasher.request_context.merge(extract_metadata(event.payload))
- event = LogStash::Event.new('@source' => LogStasher.source, '@fields' => data, '@tags' => tags)
+ event = LogStash::Event.new(data.merge('source' => LogStasher.source, 'tags' => tags))
logger << event.to_json + "\n"
end
def extract_metadata(payload)
payload.slice(*MAILER_FIELDS)