<% begin %> <% raise RuntimeError, "Tailog.log_path is not present!" unless Tailog.log_path %> <% if params[:file] %> <% file_path = File.join Tailog.log_path, params[:file] %> <% File.open file_path do |file| %>
<% end %> <% else %> <% Dir[File.join Tailog.log_path, '**/*.log'].each do |file| %> <% relative_file = Pathname.new(file).relative_path_from(Pathname.new(Tailog.log_path)) %> <% stat = File.stat(file) %> <% end %>
File name Size Updated at
<%= file %> <%= stat.size.to_filesize %> <%= stat.mtime %>
<% end %> <% rescue => error %> <%= erb :error, locals: { error: error }, layout: false %> <% end %>