lib/samson/syslog_formatter.rb
# called by activesupport / implementation copied from activesupport
called by activesupport / implementation copied from activesupport
called by activesupport / implementation copied from activesupport
def call(severity, timestamp, _progname, message)
      message_h =
        if message.is_a?(String) && message.start_with?('{')
          begin
            JSON.parse(message)
          rescue JSON::ParserError
            {message: message}
          end
        elsif message.is_a?(Hash)
          message
        else
          {message: message}
        end
      {
        level: severity,
        "@timestamp": timestamp,
        application: "samson",
        host: Rails.application.config.samson.uri.host,
        tags: current_tags
      }.merge(message_h).to_json
    end
def call ( severity , timestamp , _progname , message ) message_h = if message . is_a? ( String ) && message . start_with? ( '{' ) begin JSON . parse ( message ) rescue JSON :: ParserError { message : message } end elsif message . is_a? ( Hash ) message else { message : message } end { level : severity , "@timestamp" : timestamp , application : "samson" , host : Rails . application . config . samson . uri . host , tags : current_tags } . merge ( message_h ) . to_json end
called by activesupport / implementation copied from activesupport
called by activesupport / implementation copied from activesupport
severity
timestamp
_progname
message