Sha256: 4845b63e1d9cf95364d816c93916f395ddb77c33813c66c5c75b77948c05cce7
Contents?: true
Size: 524 Bytes
Versions: 3
Compression:
Stored size: 524 Bytes
Contents
module Lograge module Formatters class Graylog2 def call(data) # Cloning because we don't want to mess with the original when mutating keys. my = data.clone base = { :short_message => "[#{my[:status]}] #{my[:method]} #{my[:path]} (#{my[:controller]}##{my[:action]})" } # Add underscore to every key to follow GELF additional field syntax. my.keys.each { |k| my["_#{k}".to_sym] = my[k]; my.delete(k) } my.merge(base) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
lograge-0.3.0 | lib/lograge/formatters/graylog2.rb |
lograge-0.2.2 | lib/lograge/formatters/graylog2.rb |
lograge-0.2.1 | lib/lograge/formatters/graylog2.rb |