Sha256: a75f3d659d5fed225a506e788aa3f47dc6b33e0866521e747a0df2f1c127494f

Contents?: true

Size: 520 Bytes

Versions: 4

Compression:

Stored size: 520 Bytes

Contents

require 'logger'
require 'http'

module LogDNA
  class RubyLogger < ::Logger
    include LogDNA

    attr_reader :open
    attr_accessor :api_key, :host, :default_app, :ip, :mac

    def initialize(api_key, hostname, options = {})
      @conn = HTTP.persistent LogDNA::INGESTER_DOMAIN
      opts = fill_opts_with_defaults(options)
      super(opts[:logdev], opts[:shift_age], opts[:shift_size])
      set_ivars(api_key, hostname, options)
    end

    def <<(msg)
      super
      push_to_buffer(msg)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
logdna-0.0.8 lib/logdna/ruby_logger.rb
logdna-0.0.7 lib/logdna/ruby_logger.rb
logdna-0.0.6 lib/logdna/ruby_logger.rb
logdna-0.0.5 lib/logdna/ruby_logger.rb