Fix to zip fluentd-ui log when FLUENTD_UI_PATH given

This commit is contained in:
uu59 2014-07-29 10:52:40 +09:00
parent 8bd2961232
commit a6d11053d4

View File

@ -39,7 +39,11 @@ class MiscController < ApplicationController
Zip::File.open(path, Zip::File::CREATE) do |zip|
zip.get_output_stream('fluentd.log') {|f| f.puts fluentd.agent.log }
if ENV["FLUENTD_UI_LOG_PATH"].present?
zip.add("fluentd-ui.log", ENV["FLUENTD_UI_LOG_PATH"])
else
zip.add("fluentd-ui.log", Rails.root.join("log/#{Rails.env}.log"))
end
zip.get_output_stream('env.txt') do |f|
ENV.to_a.each do |(key, value)|
f.puts "#{key}=#{value}"