class LogStash::Outputs::LogstashAzureBlobOutput::SizeRotationPolicy
a sub class of LogstashAzureBlobOutput
sets the rotation policy by size
Attributes
size_file[R]
Public Class Methods
new(size_file)
click to toggle source
initialize the class
# File lib/logstash/outputs/blob/size_rotation_policy.rb, line 9 def initialize(size_file) if size_file <= 0 raise LogStash::ConfigurationError.new('`size_file` need to be greather than 0') end @size_file = size_file end
Public Instance Methods
needs_periodic?()
click to toggle source
boolean method
# File lib/logstash/outputs/blob/size_rotation_policy.rb, line 23 def needs_periodic? false end
rotate?(file)
click to toggle source
boolean method to check if it is time to rotate
# File lib/logstash/outputs/blob/size_rotation_policy.rb, line 18 def rotate?(file) file.size >= size_file end