Class: LogStash::Outputs::OSS::SizeBasedRotation

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(size_rotate) ⇒ SizeBasedRotation

Returns a new instance of SizeBasedRotation.



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

def initialize(size_rotate)
  if size_rotate <= 0
    raise LogStash::ConfigurationError, "Logstash OSS output has wrong configuration: size_rotate must be positive if strategy is `size`"
  end
  @size_rotate = size_rotate
end

Instance Attribute Details

#size_rotateObject (readonly)

Returns the value of attribute size_rotate.



6
7
8
# File 'lib/logstash/outputs/oss/rotations/size_based_rotation.rb', line 6

def size_rotate
  @size_rotate
end

Instance Method Details

#needs_periodic_check?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/logstash/outputs/oss/rotations/size_based_rotation.rb', line 19

def needs_periodic_check?
  false
end

#rotate?(file) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/logstash/outputs/oss/rotations/size_based_rotation.rb', line 15

def rotate?(file)
  file.size >= @size_rotate
end