Class: Ahoy::Stores::FluentdStore

Inherits:
LogStore show all
Defined in:
lib/ahoy/stores/fluentd_store.rb

Instance Method Summary collapse

Methods inherited from LogStore

#track_event, #track_visit

Methods inherited from BaseStore

#authenticate, #exclude?, #generate_id, #initialize, #report_exception, #track_event, #track_visit, #user, #visit

Constructor Details

This class inherits a constructor from Ahoy::Stores::BaseStore

Instance Method Details

#log_event(data) ⇒ Object



8
9
10
# File 'lib/ahoy/stores/fluentd_store.rb', line 8

def log_event(data)
  logger.post("event", data)
end

#log_visit(data) ⇒ Object



4
5
6
# File 'lib/ahoy/stores/fluentd_store.rb', line 4

def log_visit(data)
  logger.post("visit", data)
end

#loggerObject



12
13
14
# File 'lib/ahoy/stores/fluentd_store.rb', line 12

def logger
  @logger ||= Fluent::Logger::FluentLogger.new("ahoy", host: ENV["FLUENTD_HOST"] || "localhost", port: ENV["FLUENTD_PORT"] || 24224)
end