Sha256: d34fff8b2cec26cd4c7c9a33b813805b06c187e3db333266dbe8ce0eb613a825

Contents?: true

Size: 441 Bytes

Versions: 4

Compression:

Stored size: 441 Bytes

Contents

module LogStashLogger
  module Formatter
    class CeeSyslog < Cee
      def call(severity, time, progname, message)
        @progname = progname
        super
      end

      private

      def build_facility(host)
        facility = host.dup
        facility << " #{@progname}" if @progname
        facility
      end

      def format_event(event)
        "#{build_facility(event["host".freeze])}:#{super}\n"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
logstash-logger-p-0.26.1 lib/logstash-logger/formatter/cee_syslog.rb
logstash-logger-yajl-0.27.0 lib/logstash-logger/formatter/cee_syslog.rb
logstash-logger-0.26.1 lib/logstash-logger/formatter/cee_syslog.rb
logstash-logger-0.26.0 lib/logstash-logger/formatter/cee_syslog.rb