Class: LogStash::Outputs::OSS::HybridRotation

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/outputs/oss/rotations/hybrid_rotation.rb

Instance Method Summary collapse

Constructor Details

#initialize(size_rotate, time_rotate) ⇒ HybridRotation

Returns a new instance of HybridRotation.



9
10
11
12
# File 'lib/logstash/outputs/oss/rotations/hybrid_rotation.rb', line 9

def initialize(size_rotate, time_rotate)
  @size_strategy = SizeBasedRotation.new(size_rotate)
  @time_strategy = TimeBasedRotation.new(time_rotate)
end

Instance Method Details

#needs_periodic_check?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/logstash/outputs/oss/rotations/hybrid_rotation.rb', line 18

def needs_periodic_check?
  true
end

#rotate?(file) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/logstash/outputs/oss/rotations/hybrid_rotation.rb', line 14

def rotate?(file)
  @size_strategy.rotate?(file) || @time_strategy.rotate?(file)
end