Writes structured messages to logentries.com via the “le” gem, which uses its own asynchronous worker thread for network data. Thus, a Hoodoo::Logger::FastWriter subclass. See also Hoodoo::Logger.

Methods
N
R
Class Public methods
new( token )

Create a log writer instance.

token

Your logentries.com API token.

# File lib/hoodoo/logger/writers/log_entries_dot_com_writer.rb, line 29
def initialize( token )
  @@logger ||= Le.new( token, :ssl => true )
end
Instance Public methods
report( log_level, component, code, data )
# File lib/hoodoo/logger/writers/log_entries_dot_com_writer.rb, line 35
def report( log_level, component, code, data )
  method = case log_level
    when :debug, :info, :warn, :error
      log_level
    else
      :unknown
  end

  message = {
    :level     => log_level,
    :component => component,
    :code      => code,
    :data      => data
  }

  # This method is only called if the log level set elsewhere
  # is already appropriate; always make sure that the 'LE' class
  # logging level is as low as possible so it doesn't filter any
  # additional messages accidentally.

  @@logger.level = ::Logger::DEBUG
  @@logger.send( method, ::JSON.generate( message ) )
end