<% if params[:file] %> <% file_path = File.join Tailog.log_path, params[:file] %> <% begin %> <% File.open file_path do |file| %>
<% file_size = file.size %> <% file.tail(100).each do |line| %>

<%= h line %>

<% end %>
<% end %> <% rescue => error %>

<%= h error.class %>: <%= h error.message %>

<% error.backtrace.each do |backtrace| %> <%= h backtrace %>
<% end %>
<% 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)) %> <%= file %> <% end %>
<% end %>