Class: FluQ::Handler::Log

Inherits:
Base
  • Object
show all
Defined in:
lib/fluq/handler/log.rb

Defined Under Namespace

Classes: FilePool

Instance Attribute Summary collapse

Attributes inherited from Base

#config, #name

Instance Method Summary collapse

Methods inherited from Base

#filter, #timers, type

Methods included from Mixins::Loggable

#logger

Constructor Details

#initializeLog

Returns a new instance of Log.

See Also:



21
22
23
24
25
26
27
# File 'lib/fluq/handler/log.rb', line 21

def initialize(*)
  super
  @path    = config[:path]
  @rewrite = config[:rewrite]
  @convert = config[:convert]
  @pool    = FilePool.new max_size: config[:cache_max], ttl: config[:cache_ttl]
end

Instance Attribute Details

#poolObject (readonly)



18
19
20
# File 'lib/fluq/handler/log.rb', line 18

def pool
  @pool
end

Instance Method Details

#on_events(events) ⇒ Object

See Also:



30
31
32
# File 'lib/fluq/handler/log.rb', line 30

def on_events(events)
  partition(events).each {|path, slice| write(path, slice) }
end