Method: FluentdLog#read
- Defined in:
- app/models/fluentd_log.rb
#read ⇒ Object
8 9 10 11 12 |
# File 'app/models/fluentd_log.rb', line 8 def read return "" unless File.exists?(log_file) content = File.open(log_file, "r+:ascii-8bit"){|f| f.read } # TODO: large log file content.force_encoding('utf-8').valid_encoding? ? content : content.force_encoding('ascii-8bit') end |