Class: LogStash::Outputs::Gcs::LogFileFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/outputs/gcs/temp_log_file.rb

Overview

LogFileFactory creates a LogFile according to user specification optionally gzipping it and creating mutexes around modification points.

Class Method Summary collapse

Class Method Details

.create(path, gzip, synchronize = true, gzip_encoded = false) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/logstash/outputs/gcs/temp_log_file.rb', line 13

def self.create(path, gzip, synchronize=true, gzip_encoded=false)
  lf = LogStash::Outputs::Gcs::PlainLogFile.new(path)
  lf = LogStash::Outputs::Gcs::GzipLogFile.new(lf) if gzip
  lf = LogStash::Outputs::Gcs::GzipLogFile.new(lf) if gzip_encoded
  lf = LogStash::Outputs::Gcs::SynchronizedLogFile.new(lf) if synchronize

  lf
end